LinuxÖеŤ×÷¶ÓÁÐ(work queue)
¹¤×÷¶ÓÁÐ(work queue)ÊÇLinux kernelÖн«¹¤×÷ÍƺóÖ´ÐеÄÒ»ÖÖ»úÖÆ¡£ÕâÖÖ»úÖƺÍBH(bottom half)»òTasklets²»Í¬Ö®´¦ÔÚÓÚ¹¤×÷¶ÓÁÐÊÇ°ÑÍƺóµÄ¹¤×÷½»ÓÉÒ»¸öÄÚºËÏß³ÌÈ¥Ö´ÐУ¬Òò´Ë¹¤×÷¶ÓÁеÄÓÅÊƾÍÔÚÓÚËüÔÊÐíÖØе÷¶ÈÉõÖÁ˯Ãß¡£
linux 2.6.20ÒԺ󣬹¤×÷¶ÓÁлúÖƺÍ֮ǰµÄ°æ±¾ÓÐÒ»µã²»Í¬£¬ÔÚÍøÉÏÕÒÁËÒ»µã×ÊÁÏ£¬Ò²ÏàÓ¦µÄ¿´ÁËһЩcode£¬ÏÖÔÚ×Ô¼º×ܽáһϣº
ÔÎIJο¼£º
http://wiki.365linux.cn/index.php?doc-view-39
http://blog.csdn.net/lanmanck/archive/2009/11/05/4770030.aspx
work queueµÄÍ·Îļþ£º /kernel/include/linux/workqueue.h
work queueµÄÊý¾Ý½á¹¹£º
struct work_struct {
atomic_long_t data;
#define WORK_STRUCT_PENDING 0 /* T if work item pending execution */
#define WORK_STRUCT_FLAG_MASK (3UL)
#define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK)
struct list_head entry;
work_func_t func;
#ifdef CONFIG_LOCKDEP
struct lockdep_map lockdep_map;
#endif
};
ÆäÖÐ work_func_t µÄ¶¨ÒåÈçÏ£º
typedef void (*work_func_t)(struct work_struct *work);
work queue Ö÷ÒªµÄ API£º
INIT_WORK(struct work_struct *work, work_func_t func)
INIT_DELAYED_WORK(struct delayed_work *work, work_func_t func)
int schedule_work(struct work_struct *work)
void flush_scheduled_work(void)
int schedule_delayed_work(struct delayed_work *work, unsigned long delay)
int cancel_delayed_work(struct delayed_work *work)
struct workqueue_struct *create_workqueue(const char *name)
int queue_work(struct workqueue_struct *wq, struct work_struct *work)
int queue_delayed_work(struct workqueue_struct *wq, struct delayed_work *work, unsigned long delay)
void flush_workqueue(struct workqueue_struct *wq)
void destroy_workqueue(struct workqueue_struct *wq)
work queue µÄʹÓÃʵÀý£º
struct my_work_t {
ch
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
from: http://www.21andy.com/blog/20060820/389.html
linux½âѹ tarÃüÁî
tarÃüÁî
tar [-cxtzjvfpPN] ÎļþÓëĿ¼ ....
²ÎÊý£º
-c £º½¨Á¢Ò»¸öѹËõÎļþµÄ²ÎÊýÖ¸Áî(create µÄÒâ˼)£»
-x £º½â¿ªÒ»¸öѹËõÎļþµÄ²ÎÊýÖ¸Á
-t £º²é¿´ tarfile ÀïÃæµÄÎļþ£¡
Ìرð×¢Ò⣬ÔÚ²ÎÊýµÄÏ´ïÖУ¬ c/x/t ½öÄÜ´æÔÚÒ»¸ö£¡²» ......
ÄÚºËÓëÓ¦ÓóÌÐò·Ö¿ª¹¹½¨
ÄÚºËÓëÓ¦ÓóÌÐò±»Éè¼Æ³É·Ö¿ª¹¹½¨µÄ£¬ÓÉCÍ·ÎļþºÍC¿âʵÏÖ£¨KEMIN:ÎÒÃÇÒ»°ã¶¼ÊÇ»ùÓÚ¿â±àÒë¹¹½¨Ó¦ÓóÌÐò£¬ÕâÊÇĬÈϵġ£µ«ÊÇÈç¹ûûÓÐÓëʵʱϵͳµÄͳһ¹¹½¨·½Ê½¶Ô±È£¬ÈÏʶÃæºÜµ¥Ò»£¬ÄÑÒÔ½ÏÈ«ÃæÈÏʶ¹¹½¨Èí¼þµÄ±¾ÖÊ£©¡£·Ö¿ª¹¹½¨µÄÓŵãÊÇÒ×ÓÚ¶ÀÁ¢¿ª·¢ÐÂÓ¦Óã¬Âú×㶯̬ÐèÇó£»È±µã»ò´ú¼ÛÊǶÔÄÚºËÓëÓ¦ÓÃµÄ½Ó¿Ú ......