LinuxϵÄC±à³ÌÈëÃÅÖ®¡°Ï̡߳±¿ØÖÆÓë¡°Ï̡߳±Í¨Ðűà³Ì
±¾ÎÄÀ´×Ô:Linux½Ì³Ì -- http://doc.linuxpk.com/53295.html
ÈçÓв»Ã÷°×Ö®´¦£¬»¶Ó²Î¼ÓÉçÇøÌÖÂÛ
1.Linux“Ï߳̔
±ÊÕßÔø¾ÔÚ¡¶»ùÓÚǶÈëʽ²Ù×÷ϵͳVxWorksµÄ¶àÈÎÎñ²¢·¢³ÌÐòÉè¼Æ¡·£¨¡¶Èí¼þ±¨¡·2006ÄêµÚ5~12ÆÚ£©ÖÐÏêϸÐðÊöÁ˽ø³ÌºÍÏ̵߳ÄÇø±ð£¬²¢Ôø¾ËµÃ÷LinuxÊÇÒ»ÖÖ“¶à½ø³Ìµ¥Ï߳̔µÄ²Ù×÷ϵͳ¡£Linux±¾ÉíÖ»Óнø³ÌµÄ¸ÅÄ¶øÆäËùνµÄ“Ï߳̔±¾ÖÊÉÏÔÚÄÚºËÀïÈÔÈ»Êǽø³Ì¡£´ó¼ÒÖªµÀ£¬½ø³ÌÊÇ×ÊÔ´·ÖÅäµÄµ¥Î»£¬Í¬Ò»½ø³ÌÖеĶà¸öÏ̹߳²Ïí¸Ã½ø³ÌµÄ×ÊÔ´£¨Èç×÷Ϊ¹²ÏíÄÚ´æµÄÈ«¾Ö±äÁ¿£©¡£LinuxÖÐËùνµÄ“Ïֻ߳̔ÊÇÔÚ±»´´½¨µÄʱºò“¿Ë¡”(clone)Á˸¸½ø³ÌµÄ×ÊÔ´£¬Òò´Ë£¬clone³öÀ´µÄ½ø³Ì±íÏÖΪ“Ï߳̔£¬ÕâÒ»µãÒ»¶¨ÒªÅªÇå³þ¡£ LinuxÄÚºËÖ»ÌṩÁËÇáÁ¿½ø³ÌµÄÖ§³Ö£¬Î´ÊµÏÖÏß³ÌÄ£ÐÍ£¬µ«Linux¾¡×î´óŬÁ¦ÓÅ»¯Á˽ø³ÌµÄµ÷¶È¿ªÏú£¬ÕâÔÚÒ»¶¨³Ì¶ÈÉÏÃÖ²¹ÎÞÏ̵߳ÄȱÏÝ¡£LinuxÓÃÒ»¸öºËÐĽø³Ì£¨ÇáÁ¿½ø³Ì£©¶ÔÓ¦Ò»¸öỊ̈߳¬½«Ï̵߳÷¶ÈµÈͬÓÚ½ø³Ìµ÷¶È£¬½»¸øºËÐÄÍê³É¡£
Ä¿Ç°LinuxÖÐ×îÁ÷ÐеÄÏ̻߳úÖÆΪLinuxThreads£¬Ëù²ÉÓõľÍÊÇỊ̈߳½ø³Ì“Ò»¶ÔÒ»”Ä£ÐÍ£¬µ÷¶È½»¸øºËÐÄ£¬¶øÔÚÓû§¼¶ÊµÏÖÒ»¸ö°üÀ¨ÐźŴ¦ÀíÔÚÄÚµÄÏ̹߳ÜÀí»úÖÆ¡£LinuxThreadsÓÉXavier Leroy (Xavier.Leroy@inria.fr)¸ºÔ𿪷¢Íê³É£¬²¢ÒÑ°ó¶¨ÔÚGLIBCÖз¢ÐУ¬ËüʵÏÖÁËÒ»ÖÖBiCapitalizedÃæÏòLinuxµÄPosix 1003.1c “pthread”±ê×¼½Ó¿Ú¡£Linuxthread¿ÉÒÔÖ§³ÖIntel¡¢Alpha¡¢MIPSµÈƽ̨ÉϵĶദÀíÆ÷ϵͳ¡£
°´ÕÕPOSIX 1003.1c ±ê×¼±àдµÄ³ÌÐòÓëLinuxthread ¿âÏàÁ´½Ó¼´¿ÉÖ§³ÖLinuxƽ̨ÉϵĶàỊ̈߳¬ÔÚ³ÌÐòÖÐÐè°üº¬Í·Îļþpthread. h£¬ÔÚ±àÒëÁ´½ÓʱʹÓÃÃüÁ
gcc -D -REENTRANT -lpthread xxx. c
ÆäÖÐ-REENTRANTºêʹµÃÏà¹Ø¿âº¯Êý(Èçstdio.h¡¢errno.hÖк¯Êý) ÊÇ¿ÉÖØÈëµÄ¡¢Ḭ̈߳²È«µÄ(thread-safe)£¬-lpthreadÔòÒâζ×ÅÁ´½Ó¿âĿ¼ÏµÄlibpthread.a»òlibpthread.soÎļþ¡£Ê¹ÓÃLinuxthread¿âÐèÒª2.0ÒÔÉÏ°æ±¾µÄLinuxÄں˼°ÏàÓ¦°æ±¾µÄC¿â(libc 5.2.18¡¢libc 5.4.12¡¢libc 6)¡£
2.“Ï߳̔¿ØÖÆ
Ï̴߳´½¨
½ø³Ì±»´´½¨Ê±£¬ÏµÍ³»áΪÆä´´½¨Ò»¸öÖ÷Ị̈߳¬¶øÒªÔÚ½ø³ÌÖд´½¨ÐµÄỊ̈߳¬Ôò¿ÉÒÔµ÷ÓÃpthread_create£º
pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *
(start_routine)(void*), void *arg);
start_routineΪÐÂÏ̵߳ÄÈë¿Úº¯Êý£¬argΪ´«µÝ¸østart_routineµÄ²ÎÊý¡£
ÿ¸öÏ̶߳¼ÓÐ×Ô¼ºµÄÏß³ÌID£¬Ò
Ïà¹ØÎĵµ£º
linuxÊÇÒ»¸ö¸´ÔÓµÄÈí¼þϵͳ£¬ÆäÄÚºËÔ´´úÂëÍùÍù»áÓõ½Ò»Ð©ÔÚÓ¦ÓóÌÐòÉè¼ÆÖв¿³£¼ûÓïÑԳɷֺͱà³Ì¼¼ÇÉ£¬ÕâЩ¶¼ÊÇ·ÖÎöÄÚºËÔ´´úÂëµÄ»ù±¾¹¦£¬Ï£Íû´ó¼ÒÄÜÖصãÕÆÎÕ¡£
Ê×ÏÈ£¬gcc±àÒëÆ÷´ÓÓïÑÔÀïÎüÊÕÁË“inline”ºÍ“const”¡£inlineº¯ÊýµÄ´óÁ¿Ê¹Óã¬ÓÐÀûÓÚÌá¸ßÔËÐ ......
niginx°²×°Á÷³Ì
Èí¼þÏÂÔØ:--->
mkdir -p /home/dancebear/programe
cd /home/dancebear/programe
wget http://sysoev.ru/nginx/nginx-0.6.31.tar.gz
wget http://www.php.net/get/php-5.2.6.tar.gz/from/this/mirror
wget http://php-fpm.anight.org/downloads/head/php-5.2.6-fpm-0.5.8.diff.gz
wget http://dev ......
ʹÓà gperf ʵÏÖ¸ßЧµÄ C/C++ ÃüÁîÐд¦Àí
GNU ÍêÃÀ£¨gperf£©É¢Áк¯ÊýÉú³ÉÆ÷¼ò»¯¸´ÔÓµÄÊäÈë×Ö·û´®
ÎĵµÑ¡Ïî
¼¶±ð£º Öм¶
Arpan Sen
(arpan@syncad.com
), ¼¼ÊõÖ÷¹Ü, Synapti Computer Aided Design Pvt Ltd
2007 Äê 9 ÔÂ 10 ÈÕ
GNU µÄ gperf ¹¤¾ßÊÇÒ»ÖÖ “ÍêÃÀµÄ” É¢Áк¯Êý£¬¿ÉÒÔΪÓû§ÌṩµÄÒ»×éÌØ ......
Cר¼Ò±à³Ì ¾«±àÖ®Ò» µÚÒ»ÕÂ~µÚÈýÕÂ
CµÄ¸´ÔÓÖ®´¦ ÔÚÓÚËüµÄÖ¸Õë ,µ«ÊDZÈÆäÖ¸Õë¸üΪ¸´ÔÓµÄÊÇËüµÄÉùÃ÷ !!!
ÄãÄÜ¿´¶®ËüÃǵÄÒâ˼ Âð?
apple=sizeof(int)*p ; apple=sizeof * p;
j= (char (*)[20])malloc(20);
int const * grape; Óë int * const gr ......
ÒýÑÔ
¾¡¹Ü C ÓïÑÔÎÊÊÀÒѽü 30 Ä꣬µ«ËüµÄ÷ÈÁ¦ÈÔδ¼õÍË¡£C ÓïÑÔ¼ÌÐøÎüÒý×ÅÖÚ¶àµÄ¿ª·¢Õߣ¬ËûÃÇΪÁ˱àд¡¢ÒÆÖ²»òά»¤Ó¦ÓóÌÐò¶ø±ØÐëѧϰм¼ÄÜ¡£
±¾ÎÄÊÇΪÁËÂú×ã¶ÔCÓïÑÔ³õѧÕß»òÏëÌá¸ß×ÔÉíCÓïÑÔÐÞΪµÄ¿ª·¢ÈËÔ±µÄÐèÒª¶øдµÄ¡£Ï£Íû¶ÔÄúµÄѧϰºÍ¹¤×÷ÓÐËù°ïÖú¡£ÄúÒ²Ðí²»ÔÞͬÆäÖеÄijЩ·½·¨£¬µ«ÎÒÃÇÏ£ÍûÄú»áϲ»¶ÆäÖеÄһЩ¡£
±¾Î ......