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

linux關ÓÚlikely與unlikely

Ô­À´likelyºÍunlikelyÊÇÓÃÀ´±àÒëÓÅ»¯µÄ£¬Æäʵ¶¼¿ÉÒÔûÓС£ÎÒÃÇÖªµÀºÜ¶àcpuÀïÃæÓиæËß»º´æ£¬ÇÒÓÐÔ¤¶Á»úÖÆ£¬likelyºÍunlikely¾ÍÊÇÔö¼ÓÖ´ÐÐÅжÏÓï¾äʱµÄÃüÖÐÂÊ¡£
Èç¹ûÊÇif(lilely(a))£¬ËµÃ÷aÌõ¼þ·¢ÉúµÄ¿ÉÄÜÐÔ´ó£¬ÄÇôaΪÕæµÄÓï¾äÔÚ±àÒë³É¶þ½øÖƵÄʱºò¾ÍÓ¦¸Ã½ô¸úÔÚÇ°Ãæ³ÌÐòµÄºóÃ棬ÕâÑù¾Í»á±»cacheÔ¤¶ÁÈ¡½øÈ¥£¬Ôö¼Ó³ÌÐòÖ´ÐÐËٶȡ£ unlikelyÔòÊÇÕýºÃÏà·´¡£
kernelÀïÃæµÄ¶¨Ò壺
#ifndef __LINUX_COMPILER_H
#define __LINUX_COMPILER_H
/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
a mechanism by which the user can annotate likely branch directions and
expect the blocks to be reordered appropriately. Define __builtin_expect
to nothing for earlier compilers. */
#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
#define __builtin_expect(x, expected_value) (x)
#endif
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
#endif /* __LINUX_COMPILER_H */
¿ÉÒÔ¿´µ½ÔÚ2.96ÒÔÇ°°æ±¾ÖУ¬gcc²¢Ã»ÓÐʵÏÖlilelyºÍunlikely¡£ÔÚgccÒÔºó°æ±¾ÖУ¬__builtin_expectÊÇgccµÄÄÚÖú¯Êý¡£


Ïà¹ØÎĵµ£º

linuxʵÑéÈý

ʵÑé3 LinuxµÄ½ø³Ì¿ØÖÆ
Ò».ʵÑéÄ¿µÄ
ͨ¹ýʵÑéÕÆÎÕLinuxÖнø³Ì¿ØÖƵĻù±¾ÃüÁî¡£
¶þ.ʵÑéÒªÇó
1.Á·Ï°Ê¹ÓÃwho, w, ps,pstree²ì¿´ÏµÍ³Óû§¼°½ø³ÌµÄÐÅÏ¢¡£
2.Á·Ï°Ê¹ÓÃkillÃüÁî³·Ïú½ø³Ì¡£
3.Á·Ï°½ø³ÌÇ°ºǫ́µÄÇл»¡£
Èý¡¢         ʵÑ鱨¸æÒªÇó
1£®      ......

linuxʵÑéËÄ

ʵÑé4  Linux³ÌÐò¿ª·¢»ù´¡
Ò»¡¢ÊµÑéÄ¿µÄ£º
1.      ¼ÌÐøÊìϤLinuxÖÕ¶ËÃüÁ
2.      ¼ÌÐøѧϰʹÓÃVi±à¼­Æ÷£»
3.      ѧϰʹÓÃLinux»·¾³ÏÂCÓïÑÔ³ÌÐòµÄ±àÒë¡£
4.      µ÷ÊÔÆ÷GdbµÄʹÓÃ
¶þ¡¢ÊµÑéÒªÇó£º
& ......

linuxʵÑéÎå

ʵÑé5  ½ø³Ì¹ÜÀí
Ò»¡¢ÊµÑéÄ¿µÄ£º
1.      Á˽â½ø³ÌÓë³ÌÐòµÄÇø±ð£¬¼ÓÉî¶Ô½ø³Ì¸ÅÄîµÄÀí½â¼Ó£»
2£® ÕÆÎÕ½ø³Ì²¢·¢Ö´ÐеÄÔ­Àí£¬¼°ÆäËùÒýÆðµÄͬ²½¡¢»¥³âÎÊÌâµÄ·½·¨
¶þ¡¢ÊµÑéÒªÇó£º
    Íê³ÉʵÑéÄÚÈݲ¢Ð´³öʵÑ鱨¸æ£¬±¨¸æÓ¦¾ßÓÐÒÔÏÂÄÚÈÝ£º
    1£® Ê ......

LinuxÏÂApacheµÄ°²×°

µØÖ·£ºhttp://httpd.apache.org/
ÏÂÔصØÖ·£ºhttp://httpd.apache.org/download.cgi
1,½âѹËõ
tar -xzvf httpd-2.0.63.tar.gz
2,ÅäÖÃ
./configure --prefix=/usr/local/apache --enable-module=all --enable-shared=max
3,±àÒë
make
4,°²×°
make install
5,¹ÜÀí
apachectl start
apachectl stop
apachectl rest ......

ÓÃNohupÃüÁîÈÃLinuxϵijÌÐòÔÚºǫִ́ÐÐ

Unix/LinuxÏÂÒ»°ãÏëÈÃij¸ö³ÌÐòÔÚºǫ́ÔËÐУ¬ºÜ¶à¶¼ÊÇʹÓà & ÔÚ³ÌÐò½áβÀ´ÈóÌÐò×Ô¶¯ÔËÐС£±ÈÈçÎÒÃÇÒªÔËÐÐmysqlÔÚºǫ́£º
¡¡¡¡/usr/local/mysql/bin/mysqld_safe –user=mysql &
¡¡¡¡µ«ÊÇÎÒÃǺܶà³ÌÐò²¢²»ÏómysqldÒ»Ñù¿ÉÒÔ×ö³ÉÊØ»¤½ø³Ì£¬¿ÉÄÜÎÒÃǵijÌÐòÖ»ÊÇÆÕͨ³ÌÐò¶øÒÑ£¬Ò»°ãÕâÖÖ³ÌÐò¼´Ê¹Ê¹Óà & ½á⣬Èç¹ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ