Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ʵÑéËÄ

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

linux¾ÖÓòÍøÍ¨ÐÅÈí¼þiptux£¬ipmsg

windowsÏÂÓзdz£ºÃÓõľÖÓòÍøÍ¨ÐÅÈí¼þ£ºipmsg£¨·É¸ë´«Ê飩¡£
ipmsgÒ²ÓÐlinux°æ±¾£¬µ«ÊÇ£¬ÓÐbug£¬¸üÐÂÒ²Âý¡£
linuxÏÂÓÐÒ»¸ö¹úÈË¿ª·¢µÄiptux£¬¼æÈÝipmsgЭÒ飬¿çƽ̨ʹÓ㬸üÐÂÒ²ºÜ¿ì£¬Äã¿ÉÒÔËæÊ±Ìá½»bug£¬×÷Õß»áºÜ¿ìÐ޸ġ£
1. iptux
°²×°iptux±È½ÏÈÝÒ×£¬ÏÂÔØiptuxµÄ¶þ½øÖưühttp://iptux.googlecode.com/files/iptux_0.4 ......

LinuxÏÂnginxµÄ°²×°ÎÊÌâ

×î½ü×¼±¸¸ø¹«Ë¾µÄÍøÕ¾¼Ü¹¹×öϵ÷Õû£¬°²×°²¿ÊðлúÆ÷µÄʱºòÓöµ½Ò»Ð©ÎÊÌ⣬nginxÔÚ°²×°µÄʱºòÒ»Ö±ÌáʾδÕÒµ½openssl
./configure --prefix=/usr/local/nginx
 ³ÌÐò´úÂë
./configure: error: the HTTP cache module requires md5 functions from OpenSSL library.  You can either disable the module by us ......

̰Ðݲװ64λlinuxµÄÞÏÞÎ

administer@administer-laptop:~/tem/tt$ cat hello.asm
[section .data]
strHello db "Hello, world!",0Ah
STRLEN  equ $-strHello
[section .text]
global _start
_start: 
mov edx,STRLEN
mov ecx,strHello
mov ebx,1
mov eax,4
int  0x80
mov  ......

LinuxÏÂRamdisk¸ùÎļþÏµÍ³ÖÆ×÷¹ý³Ì½âÎö

  http://blog.csdn.net/hzdysymbol/archive/2009/01/17/3796814.aspxÒ»¡¢ÔÚÒ»¸öÒѽ¨ºÃµÄÎļþϵͳÉϽøÐÐÐÞ¸Ä
    ÉèÒѽ¨Á¢ºÃµÄÎļþϵͳѹËõÎļþΪramdisk.gz
    1¡¢½âѹ
    #cd ramdisk.gzËùÔÚĿ¼
    #gunzip ramdisk.gz
    Ô ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ