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

LinuxÏÂthread±à³Ì (Ò»)

×÷ÕߣºSam £¨Õç·å£©  sam_code@hotmail.com
SamǰЩÌìÔÚÌṩһ¸ö¿â¸ø±ðµÄ¹«Ë¾Ê±£¬ÒòΪ²»Ï²»¶Ê¹ÓÃpthread_jionµÈº¯Êý£¬±»ÈËÂîΪÀ¬»ø³ÌÐò¡£ºÇºÇ£¬Ö®Ç°ÒòΪÔÚд¶àthread³ÌÐòʱ£¬Ï°¹ßÈÃÿ¸öthread¶¼ÎªdetachÊôÐÔ£¬ÕâÑùËûÃǾͿÉÒÔ×ÔÎÒ¹ÜÀí¡£¶ø²»ÐèÒªÔÙÓɱðÈË»ØÊÕ×ÊÔ´¡£ºÇºÇ£¬²»ËµÕâô¶àÁË£¬°ÑPOSIX thread·½ÃæµÄ¶«Î÷¼ÇÏÂÀ´°É¡£
LinuxÏÂthreadÀúÊ·£¨Old pthreadÓëNPTL£©£º
Linux´´½¨Ö®³õ£¬²¢²»ÄÜÕæÕýÖ§³Öthread. LinuxThreads ÏîĿʹÓÃclone()Õâ¸öϵͳµ÷ÓÃʵÏÖ¶ÔthreadµÄÄ£Äâ¡£ÔÚ_clone±¾À´µÄÒâͼÊÇ´´½¨Ò»¸ö¿É¶¨Òå¸÷ÖÖÅäÖõĶԵ±Ç°½ø³ÌµÄ¿½±´¡£LinuxThreadsÏîÄ¿ÔòÀûÓÃÁËÕâÒ»µã£¬ÅäÖÃÁËÒ»¸öÓëµ÷Óýø³ÌÓµÓÐÏàͬµØÖ·¿Õ¼äµÄ¿½±´£¬°ÑËü×÷Ϊһ¸öthread. ËùÒÔ£¬³£³£ÓÐÈË˵£¬linuxÏÂÃæûÓнø³ÌÏß³ÌÖ®·Ö£¬Æäʵ¾ÍÊÇÕâ¸öÒâ˼¡£µ«Õâ¸ö·½·¨Ò²ÓÐÎÊÌ⣬ÓÈÆäÊÇÔÚÐźŴ¦Àí¡¢µ÷¶ÈºÍ½ø³Ì¼äͬ²½Ô­Óï·½Ã涼´æÔÚÎÊÌâ¡£ÁíÍ⣬Õâ¸öÏß³ÌÄ£ÐÍÒ²²»·ûºÏ POSIX µÄÒªÇó¡£
Èç¹ûÒª¸Ä½øLinuxThread. ºÜÃ÷ÏÔ£¬ÐèÒªkernel²ãµÄÖ§³Ö¡£IBMºÍRedHat·Ö±ð½øÐÐÁËÑо¿£¬Ëæ×ÅIBMµÄ·ÅÆú£¬RedHatµÄNative POSIX Thread Library£¨NPTL£©¾Í³ÉΨһµÄ½â¾ö·½°¸ÁË¡£Õâ¾ÍÊÇNPTL¡£
LinuxThreads ×î³õµÄÉè¼ÆÏàÐÅÏà¹Ø½ø³ÌÖ®¼äµÄÉÏÏÂÎÄÇл»ËٶȺܿ죬Òò´Ëÿ¸öÄÚºËÏß³Ì×ãÒÔ´¦ÀíºÜ¶àÏà¹ØµÄÓû§¼¶Ï̡߳£Õâ¾Íµ¼ÖÂÁËÒ»¶ÔÒ» Ïß³ÌÄ£Ð͵ĸïÃü¡£
LinuxThreads Éè¼Æϸ½ÚµÄһЩ»ù±¾ÀíÄ
LinuxThreads ·Ç³£³öÃûµÄÒ»¸öÌØÐÔ¾ÍÊǹÜÀíỊ̈߳¨manager thread£©¡£¹ÜÀíÏ߳̿ÉÒÔÂú×ãÒÔÏÂÒªÇó£º
ϵͳ±ØÐëÄܹ»ÏìÓ¦ÖÕÖ¹ÐźŲ¢É±ËÀÕû¸ö½ø³Ì¡£
ÒÔ¶ÑÕ»ÐÎʽʹÓõÄÄÚ´æ»ØÊÕ±ØÐëÔÚÏß³ÌÍê³ÉÖ®ºó½øÐС£Òò´Ë£¬Ïß³ÌÎÞ·¨×ÔÐÐÍê³ÉÕâ¸ö¹ý³Ì¡£
ÖÕÖ¹Ï̱߳ØÐë½øÐеȴý£¬ÕâÑùËüÃDzŲ»»á½øÈ뽩ʬ״̬¡£
Ï̱߳¾µØÊý¾ÝµÄ»ØÊÕÐèÒª¶ÔËùÓÐÏ߳̽øÐбéÀú£»Õâ±ØÐëÓɹÜÀíÏß³ÌÀ´½øÐС£
Èç¹ûÖ÷Ïß³ÌÐèÒªµ÷Óà pthread_exit()£¬ÄÇôÕâ¸öÏ߳̾ÍÎÞ·¨½áÊø¡£Ö÷Ïß³ÌÒª½øÈë˯Ãß״̬£¬¶ø¹ÜÀíÏ̵߳Ť×÷¾ÍÊÇÔÚËùÓÐÏ̶߳¼±»É±ËÀÖ®ºóÀ´»½ÐÑÕâ¸öÖ÷Ï̡߳£
ΪÁËά»¤Ï̱߳¾µØÊý¾ÝºÍÄڴ棬LinuxThreads ʹÓÃÁ˽ø³ÌµØÖ·¿Õ¼äµÄ¸ßλÄڴ棨¾ÍÔÚ¶ÑÕ»µØַ֮ϣ©¡£
Ô­ÓïµÄͬ²½ÊÇʹÓÃÐźŠÀ´ÊµÏֵġ£ÀýÈ磬Ï̻߳áÒ»Ö±×èÈû£¬Ö±µ½±»ÐźŻ½ÐÑΪֹ¡£
ÔÚ¿Ë¡ϵͳµÄ×î³õÉè¼Æ֮ϣ¬LinuxThreads ½«Ã¿¸öÏ̶߳¼ÊÇ×÷Ϊһ¸ö¾ßÓÐΩһ½ø³Ì ID µÄ½ø³ÌʵÏֵġ£
ÖÕÖ¹ÐźſÉÒÔɱËÀËùÓеÄÏ̡߳£LinuxThreads ½ÓÊÕµ½ÖÕÖ¹ÐźÅÖ®ºó£¬¹ÜÀíÏ߳̾ͻáʹÓÃÏàͬµÄÐźÅɱËÀËùÓÐÆäËûỊ̈߳¨½ø³Ì£©¡£
¸ù¾Ý


Ïà¹ØÎĵµ£º

linux×°JDKºÍeclipseÎÊÌâ½â¾ö

 ÎÒÓõÄUBUNTU9.04 ¡£
×°JDKʱ³öÏÖÁËDeleting temporary files...
ÆÁÄ»³ÖÐøÊ®¼¸·ÖÖÓ¶¼»¹ÊÇDeleting temporary files...¿´À´ÊÇ×°²»ÁËÁË¡£ÖØпªÊ¼×°Ò»´Î
sudo chmod a+x ./jre-6u16-linux-i586.bin
sudo ./jre-6u16-linux-i586.bin
È»ºóÔÚÖÕ¶ËÅäÖû·¾³±äÁ¿£º
export JAVA_HOME=/usr/java/jdk1.6.0_16
 &n ......

ÁªÏëÔÚÓÖ×ß»ØLinuxµÄÀÏ·?

 
¾¡¹Ü²»Ô¸Òâ¹ý·ÖÉùÕÅ£¬µ«ÁªÏëȷʵÔÚÖØ»ØLinuxµÄÀÏ·¡£11ÔÂ12ÈÕ£¬¸ßͨCEO Paul Jacobs͸¶ÁËÁªÏëÒ»¿î»ùÓÚARM¼Ü¹¹
Snapdragon´¦ÀíÆ÷µÄÖÇÄܱ¾²úÆ·£¬ÕâÖÖ²úÆ·µÄ¶¨Î»½éÓÚÖÇÄÜÊÖ»úÓëÉÏÍø±¾Ö®¼ä¡£Jacobs»¹Ðû³ÆÕâ¿î»ùÓÚLinuxµÄÖÇÄܱ¾½«ÓÚÃ÷Äê1Ô·ÝÕÙ¿ªµÄ
CES¼ÆËã»úµç×ÓÕ¹»áÉÏÕýʽ¶Ã棬¶øÁªÏëËæºóÒ²¶ÔÕâÔòÏûÏ¢½øÐÐÁËÈ·ÈÏ£¬ ......

linux¿âÎļþ±àдÈëÃÅ¡¾Õª×Ô chinaunix¡¿

תÌù×Ô: http://hi.baidu.com/harrybobo/blog/item/ae3347b51711afc637d3ca69.html
Ò»¡¢ÎªÊ²Ã´ÒªÊ¹ÓÿâÎļþ
ÎÒÃÇÔÚʵ¼Ê±à³Ì¹¤×÷Öп϶¨»áÓöµ½ÕâÖÖÇé¿ö£ºÓм¸¸öÏîÄ¿ÀïÓÐһЩº¯ÊýÄ£¿éµÄ¹¦ÄÜÏàͬ£¬
ʵÏÖ´úÂëÒ²Ïàͬ£¬Ò²ÊÇÎÒÃÇËù˵µÄÖظ´´úÂë¡£±ÈÈ磬ºÜ¶àÏîÄ¿ÀﶼÓÐÒ»¸öÓû§ÑéÖ¤µÄ¹¦ÄÜ¡£
´úÂë¶ÎÈçÏ£º
//UserLogin.hÎļþ£¬Ìá ......

Linuxϲ鿴Îļþ±àÂë,Îļþ»òÎļþÃû±àÂë¸ñʽת»»


Èç¹ûÄãÐèÒªÔÚLinuxÖвÙ×÷windowsϵÄÎļþ£¬ÄÇôÄã¿ÉÄܻᾭ³£Óöµ½Îļþ±àÂëת»»µÄÎÊÌâ¡£WindowsÖÐĬÈϵÄÎļþ¸ñʽÊÇGBK(gb2312)£¬¶øLinuxÒ»°ã¶¼ÊÇUTF-8¡£ÏÂÃæ½éÉÜһϣ¬ÔÚLinuxÖÐÈçºÎ²é¿´ÎļþµÄ±àÂë¼°ÈçºÎ½øÐжÔÎļþ½øÐбàÂëת»»¡£
Ò»£¬²é¿´Îļþ±àÂ룺
ÔÚLinuxÖв鿴Îļþ±àÂë¿ÉÒÔͨ¹ýÒÔϼ¸ÖÖ·½Ê½£º
1.ÔÚVimÖпÉÒÔÖ±½Ó²é¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ