Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linuxÄÚºË(2.6)ÖеÄË«Ñ­»·Á´±ídzÎö

       Linux 2.6ÄÚºËÁ´±íÊý¾Ý½á¹¹µÄʵÏÖ
ÔÚ¼ÆËã»ú¿ÆѧÖУ¬Á´±íÊǷdz£Í¨ÓõÄÊý¾Ý½á¹¹£¬¹á´©ÓÚÕû¸ölinuxµÄÄںˡ£ÔÚlinuxÄÚºËÖУ¬Á´±íͨ³£ÒÔ
Ë«Ñ­»·Á´±íµÄ·½Ê½³öÏÖ¡£ËùÓÐÁ´±íµÄ´úÂëÔÚinclude/linux/list.hÎļþÖС£
¶¨ÒåÈçÏ£º
struct list_head {
struct list_head *next, *prev;
};
ÕâÀïµÄlist_headûÓÐÊý¾ÝÓò¡£ÔÚLinuxÄÚºËÁ´±íÖУ¬²»ÊÇÔÚÁ´±í½á¹¹Öаüº¬Êý¾Ý£¬¶øÊÇÔÚÊý¾Ý½á¹¹Öаüº¬Á´±í¡£
list.h»¹¶¨ÒåÁËÐí¶àʹÓõĺêºÍÄÚÁªº¯Êý£¬ÏÂÃæ½éÉܼ¸¸öµäÐ͵ģº
#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
static inline void INIT_LIST_HEAD(struct list_head *list)
{
list->next = list;
list->prev = list;
}

ÔÚlinuxµÄºê¶¨ÒåÖУ¬Ê±³£Óõ½do{}while(0)£¬ÕâÊÇΪÁË·½±ãÔٺ궨ÒåÖаüº¬¶àÐдúÂ룬
¹ØÓÚÕâ¸öµÄ˵Ã÷ÔÚÍøÉÏ¿ÉÒÔÕÒµ½ºÜ¶àÏêϸµÄ½éÉÜ¡£
ÔÚºêINIT_LIST_HEADÖУ¬½«Ëü³õʼ»¯ÎªÇ°ºó¶¼Ö¸Ïò×Ô¼º
ÔÚlinuxÄں˵ÄÁ´±íÖУ¬Ò»¸ö¿ÕÁ´±í¶¨ÒåÈçÏ£º head->nextÖ¸ÏòÁ´±íµÄÍ·ÔªËØ¡£
list.hÖл¹¶¨ÒåÁË list_add() £¬ list_add_tail()£¬list_del()µÈ»ù±¾µÄÁ´±í²Ù×÷º¯Êý£¬¶¼ÊDZȽϼòµ¥µÄ
CÓïÑÔÕâÀï²»ÏêÊö¡£
 
ÔÚlist.hÖм«ÆäÓÐÓõÄÒ»¸öºêÊÇlist_for_each_entry
#define list_for_each_entry(pos, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member); \
prefetch(pos->member.next), &pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))
Ëü¿ÉÒÔ±éÀúÕû¸öÁ´±í£¬ÔÚlinuxÓõķdz£¹ã·º£¬ÀýÈçµ±CPU¿ªÊ¼¹¤×÷ʱ£¬¼¤»îÔÚ¹¤×÷¶ÓÁÐÖеÄÿ¸ö½ø³Ì
-----------------------------------------------------------------------------
kernel/workqueue.c
59 struct workqueue_struct {
60   struct cpu_workqueue_struct cpu_wq[NR_CPUS];
61   const char *name;
62   struct list_head list; /* Empty if single thread */
63 };
  ...
466   case CPU_ONLINE:
467     /* Kick off worker threads. */
468     list_for_each_entry(wq, &workqueues, list)
469     &nb


Ïà¹ØÎĵµ£º

Æß¿îǶÈëʽLinux²Ù×÷ϵͳ¼ò½é

Æß¿îǶÈëʽLinux²Ù×÷ϵͳ¼ò½é
¡¡¡¡³ýÁËÖÇÄÜÊý×ÖÖÕ¶ËÁìÓòÒÔÍ⣬LinuxÔÚÒƶ¯¼ÆËãƽ̨¡¢ÖÇÄܹ¤Òµ¿ØÖÆ¡¢½ðÈÚÒµÖÕ¶Ëϵͳ£¬ÉõÖÁ¾üÊÂÁìÓò¶¼ÓÐ׏㷺µÄÓ¦ÓÃÇ°¾°¡£ÕâЩLinux±»Í³³ÆΪ“ǶÈëʽLinux”¡£ÏÂÃæ¾ÍÀ´¿´¿´¶¼ÓÐÄÄЩǶÈëʽLinuxÔÚÒÔÉÏÁìÓò×ݺá³Û³Ò°É!
¡¡¡¡RT-Linux
¡¡¡¡ÕâÊÇÓÉÃÀ¹úÄ«Î÷¸çÀí¹¤Ñ§Ôº¿ª·¢µÄǶÈëʽLinu ......

yumÊÇʲô?(linuxÃüÁî)

 
yumÊÇʲô?(linuxÃüÁî)
Ò». yumÊÇʲô
yum = Yellow dog Updater, Modified
Ö÷Òª¹¦ÄÜÊǸü·½±ãµÄÌí¼Ó/ɾ³ý/¸üÐÂRPM°ü.
ËüÄÜ×Ô¶¯½â¾ö°üµÄÒÐÀµÐÔÎÊÌâ.
ËüÄܱãÓÚ¹ÜÀí´óÁ¿ÏµÍ³µÄ¸üÐÂÎÊÌâ
×¢:ΪʲôҪʹÓÃyum¶ø²»ÓÃapt,×î¼òµ¥µÄÔ­Òò,Fedora×Ô´ø
¶þ. yumÌصã
*¿ÉÒÔͬʱÅäÖöà¸ö×ÊÔ´¿â(Repository)
*¼ò½àµÄÅäÖÃÎļ ......

linuxÐÞ¸Ä×Ö·û¼¯

 ¿ÉÒÔͨ¹ýÏÂÃæÃüÁî²é¿´µ±Ç°±àÂ뷽ʽ£º  
  h@debian-server:~/$   locale   -a  
  C  
  en_US  
  en_US.iso88591  
  en_US.iso885915  
  en_US.utf8  
  POSIX  
  zh_CN  
  zh_CN.gb1 ......

ÉîÈëLinuxÄÚºËÍøÂç¶ÑÕ»

×÷Õߣºbioforge alkerr@yifan.net
Ô­Ãû£º <<Hacking the Linux Kernel Network Stack>>
·­Ò룬Ð޸ģº duanjigang <duanjigang1983@126.com>
·­Òë²Î¿¼£ºraodan (raod_at_30san.com) 2003-08-22
µÚÒ»Õ  ¼ò½é
±¾ÎĽ«ÃèÊöÈçºÎÀûÓÃLinuxÍøÂç¶ÑÕ»µÄÇÏÃÅ£¨²»Ò»¶¨¶¼ÊÇ©¶´£©À´´ïµ½Ò»Ð©Ä¿µÄ£¬»ò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ