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

Linux ͬ²½·½·¨ÆÊÎö

ÎÄÕÂÀ´Ô´:http://www.ibm.com/developerworks/cn/linux/l-linux-synchronization.html
¼¶±ð£º Öм¶
M. Tim Jones, ¹ËÎʹ¤³Ìʦ, Emulex
2007 Äê 11 ÔÂ 19 ÈÕ
ÔÚѧϰ Linux® µÄ¹ý³ÌÖУ¬ÄúÒ²Ðí½Ó´¥¹ý²¢·¢£¨concurrency£©¡¢ÁÙ½ç¶Î£¨critical section£©ºÍËø¶¨£¬µ«ÊÇÈçºÎÔÚÄÚºËÖÐʹÓÃÕâЩ¸ÅÄîÄØ£¿±¾ÎÄÌÖÂÛÁË 2.6 °æÄÚºËÖпÉÓõÄËø¶¨»úÖÆ£¬°üÀ¨Ô­×ÓÔËËã·û£¨atomic operator£©¡¢×ÔÐýËø£¨spinlock£©¡¢¶Á/дËø£¨reader/writer lock£©ºÍÄÚºËÐźÅÁ¿£¨kernel semaphore£©¡£ ±¾ÎÄ»¹Ì½ÌÖÁËÿÖÖ»úÖÆ×îÊʺÏÓ¦Óõ½ÄÄЩµØ·½£¬ÒÔ¹¹½¨°²È«¸ßЧµÄÄں˴úÂë¡£
±¾ÎÄÌÖÂÛÁË Linux ÄÚºËÖпÉÓõĴóÁ¿Í¬²½»òËø¶¨»úÖÆ¡£ÕâЩ»úÖÆΪ 2.6.23 °æÄں˵ÄÐí¶à¿ÉÓ÷½·¨ÌṩÁËÓ¦ÓóÌÐò½Ó¿Ú£¨API£©¡£µ«ÊÇÔÚÉîÈëѧϰ API ֮ǰ£¬Ê×ÏÈÐèÒªÃ÷°×½«Òª½â¾öµÄÎÊÌâ¡£
developerWorks ÉÏ Tim µÄ¸ü¶à ÆÊÎö... ϵÁÐ
Linux ÎļþϵͳÆÊÎö
Linux ÍøÂç¶ÑÕ»ÆÊÎö
Linux ÄÚºËÆÊÎö
Linux slab ·ÖÅäÆ÷ÆÊÎö
Tim µÄËùÓÐ Anatomy of... ÎÄÕÂ
²¢·¢ºÍËø¶¨
µ±´æÔÚ²¢·¢ÌØÐÔʱ£¬±ØÐëʹÓÃͬ²½·½·¨¡£µ±ÔÚͬһʱ¼ä¶Î³öÏÖÁ½¸ö»ò¸ü¶à½ø³Ì²¢ÇÒÕâЩ½ø³Ì±Ë´Ë½»»¥£¨ÀýÈ磬¹²ÏíÏàͬµÄ×ÊÔ´£©Ê±£¬¾Í´æÔÚ²¢·¢ ÏÖÏó¡£
ÔÚµ¥´¦ÀíÆ÷£¨uniprocessor£¬UP£©Ö÷»úÉÏ¿ÉÄÜ·¢Éú²¢·¢£¬ÔÚÕâÖÖÖ÷»úÖжà¸öÏ̹߳²Ïíͬһ¸ö CPU ²¢ÇÒÇÀÕ¼£¨preemption£©´´½¨¾ºÌ¬Ìõ¼þ¡£ÇÀÕ¼ ͨ¹ýÁÙʱÖжÏÒ»¸öÏß³ÌÒÔÖ´ÐÐÁíÒ»¸öÏ̵߳ķ½Ê½À´ÊµÏÖ CPU ¹²Ïí¡£¾ºÌ¬Ìõ¼þ ·¢ÉúÔÚÁ½¸ö»ò¸ü¶àÏ̲߳Ù×ÝÒ»¸ö¹²ÏíÊý¾ÝÏîʱ£¬Æä½á¹ûÈ¡¾öÓÚÖ´ÐеÄʱ¼ä¡£ÔڶദÀíÆ÷£¨MP£©¼ÆËã»úÖÐÒ²´æÔÚ²¢·¢£¬ÆäÖÐÿ¸ö´¦ÀíÆ÷Öй²ÏíÏàͬÊý¾ÝµÄÏß³ÌͬʱִÐС£×¢ÒâÔÚ MP Çé¿öÏ´æÔÚÕæÕýµÄ²¢ÐУ¨parallelism£©£¬ÒòΪÏß³ÌÊÇͬʱִÐеġ£¶øÔÚ UP ÇéÐÎÖУ¬²¢ÐÐÊÇͨ¹ýÇÀÕ¼´´½¨µÄ¡£Á½ÖÖģʽÖÐʵÏÖ²¢·¢¶¼½ÏΪÀ§ÄÑ¡£
Linux ÄÚºËÔÚÁ½ÖÖģʽÖж¼Ö§³Ö²¢·¢¡£Äں˱¾ÉíÊǶ¯Ì¬µÄ£¬¶øÇÒÓÐÐí¶à´´½¨¾ºÌ¬Ìõ¼þµÄ·½·¨¡£Linux ÄÚºËÒ²Ö§³Ö¶à´¦Àí£¨multiprocessing£©£¬³ÆΪ¶Ô³Æ¶à´¦Àí£¨SMP£©¡£¿ÉÒÔÔÚ±¾ÎĺóÃæµÄ ²Î¿¼×ÊÁÏ ²¿·Öѧµ½¸ü¶à¹ØÓÚ SMP µÄ֪ʶ¡£
ÁÙ½ç¶Î¸ÅÄîÊÇΪ½â¾ö¾ºÌ¬Ìõ¼þÎÊÌâ¶ø²úÉúµÄ¡£Ò»¸öÁÙ½ç¶Î ÊÇÒ»¶Î²»ÔÊÐí¶à··ÃÎʵÄÊܱ£»¤µÄ´úÂë¡£Õâ¶Î´úÂë¿ÉÒÔ²Ù×ݹ²ÏíÊý¾Ý»ò¹²Ïí·þÎñ£¨ÀýÈçÓ²¼þÍâΧÉ豸£©¡£ÁÙ½ç¶Î²Ù×÷ʱ¼á³Ö»¥³âËø£¨mutual exclusion£©Ô­Ôò£¨µ±Ò»¸öÏ̴߳¦ÓÚÁÙ½ç¶ÎÖÐʱ£¬ÆäËûËùÓÐÏ̶߳¼²»ÄܽøÈëÁÙ½ç¶Î£©¡£
ÁÙ½ç¶ÎÖÐÐèÒª½â¾öµÄÒ»¸öÎÊÌâÊÇËÀËøÌõ¼þ¡£¿¼ÂÇÁ½¸ö¶ÀÁ¢µÄÁÙ½ç¶Î£¬¸÷×Ô±£»¤²»Í¬µÄ×ÊÔ´¡£Ã¿¸ö×Ê


Ïà¹ØÎĵµ£º

LinuxÖ¸ÒýÎÒÃÇ×ßÏòºÎ·½£¿






<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
    ½üÆÚÒÔÀ´£¬¾²¹ÛÊÀ½ç
Linux
Òµ½çµÄ¸÷ÖÖ¶¯Ïò£¬ÁîÈËÐÄÈç³±Ó¿£¬²»µÃ°²Äþ¡£´Ë»°Ôõô½²£¿
 
    Ê®¼¸ÄêÀ´£¬
Linux
ÒѾ­ÐγÉÒ»¹ÉÊÀ½çÐԵķ¢Õ¹³±Á÷£¬ÈκÎÊÆÁ¦Ò²×èµ²²»ÁË¡£Ðí¶àÊÀ½ç¼¶µÄ´ó¹ ......

linux api±Ê¼Ç£¨1£©£ºÅжÏÎļþÊÇ·ñ´æÔÚ

Èç¹ûÔÚlinux C\C++»·¾³ÏÂÅжÏij¸öÎļþÊÇ·ñ´æÔÚ£¬¿ÉÒÔʹÓÃaccessº¯Êý£º
#include <unistd.h>
#include <stdio.h>
int main()
{
        const char* file1 = "access.cpp";
        const char* file2 = "access1.cpp";
       & ......

RedHat Linux³£¼ûµÄÈÕÖ¾ÎļþºÍ³£ÓÃÃüÁî


³É¹¦µØ¹ÜÀíÈκÎϵͳµÄ¹Ø¼üÖ®Ò»£¬ÊÇÒªÖªµÀϵͳÖÐÕýÔÚ·¢ÉúʲôÊ¡£Linux ÖÐÌṩÁËÒì³£ÈÕÖ¾£¬²¢ÇÒÈÕÖ¾µÄϸ½ÚÊÇ¿ÉÅäÖõġ£Linux ÈÕÖ¾¶¼ÒÔÃ÷ÎÄÐÎʽ ´æ´¢£¬ËùÒÔÓû§²»ÐèÒªÌØÊâµÄ¹¤¾ß¾Í¿ÉÒÔËÑË÷ºÍÔĶÁËüÃÇ¡£»¹¿ÉÒÔ±àд½Å±¾£¬À´É¨ÃèÕâЩÈÕÖ¾£¬²¢»ùÓÚËüÃǵÄÄÚÈÝÈ¥×Ô¶¯Ö´ÐÐijЩ¹¦ÄÜ¡£Linux ÈÕÖ¾´æ´¢ÔÚ /var/log Ŀ¼ÖС£ÕâÀïÓм¸¸öÓ ......

LinuxϵͳԭÀí֪ʶ ½ø³ÌÇл»µÄ¸ÅÄî½éÉÜ

Ò»¡¢tast_struct½á¹¹
ËüÊÇÒ»¸öÊý¾Ý½á¹¹£¬¿ÉÒÔ˵£¬Ëü´ú±íÁËÒ»¸ö½ø³Ì¡£ËüÓкܶà×ֶΣ¬´óÌåÓÐһϼ¸ÖÖ£º
±êʶºÅ£º½ø³Ì±êʶ¡¢Óû§±êʶ¡¢×é±êʶ¡£
״̬£º LinuxµÄ½ø³ÌµÄËÄÖÖ»ù±¾×´Ì¬
µ÷¶ÈÐÅÏ¢£ºÓÅÏȼ¶¡¢Ê±¼äƬµÈ
½ø³ÌÁ´ÐÅÏ¢£º¸¸½ø³Ì¡¢×Ó½ø³ÌµÄÖ¸Õë
ÎļþÐÅÏ¢£º´ò¿ªÎļþ¡¢ÐéÄâÎļþϵͳ
ÉÏÏÂÎÄÐÅÏ¢£º½ø³ÌµÄÔËÐл·¾³ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ