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

LinuxÄں˵Äͬ²½»úÖÆ

Ò»¡¢ÒýÑÔ
ÔÚÏÖ´ú²Ù×÷ϵͳÀͬһʱ¼ä¿ÉÄÜÓжà¸öÄÚºËÖ´ÐÐÁ÷ÔÚÖ´ÐУ¬Òò´ËÄÚºËÆäʵÏó¶à½ø³Ì¶àÏ̱߳à³ÌÒ»ÑùÒ²ÐèҪһЩͬ²½»úÖÆÀ´Í¬²½¸÷Ö´Ðе¥Ôª¶Ô¹²ÏíÊý¾ÝµÄ·ÃÎÊ¡£ÓÈÆäÊÇÔڶദÀíÆ÷ϵͳÉÏ£¬¸üÐèҪһЩͬ²½»úÖÆÀ´Í¬²½²»Í¬´¦ÀíÆ÷ÉϵÄÖ´Ðе¥Ôª¶Ô¹²ÏíµÄÊý¾ÝµÄ·ÃÎÊ¡£
ÔÚÖ÷Á÷µÄLinuxÄÚºËÖаüº¬Á˼¸ºõËùÓÐÏÖ´úµÄ²Ù×÷ϵͳ¾ßÓеÄͬ²½»úÖÆ£¬ÕâЩͬ²½»úÖÆ°üÀ¨£ºÔ­×Ó²Ù×÷¡¢ÐźÅÁ¿£¨semaphore£©¡¢¶ÁдÐźÅÁ¿£¨rw_semaphore£©¡¢spinlock¡¢BKL(Big Kernel Lock)¡¢rwlock¡¢brlock£¨Ö»°üº¬ÔÚ2.4ÄÚºËÖУ©¡¢RCU£¨Ö»°üº¬ÔÚ2.6ÄÚºËÖУ©ºÍseqlock£¨Ö»°üº¬ÔÚ2.6ÄÚºËÖУ©¡£
¶þ¡¢Ô­×Ó²Ù×÷
Ëùνԭ×Ó²Ù×÷£¬¾ÍÊǸòÙ×÷¾ø²»»áÔÚÖ´ÐÐÍê±ÏÇ°±»ÈκÎÆäËûÈÎÎñ»òʼþ´ò¶Ï£¬Ò²¾Í˵£¬ËüµÄ×îСµÄÖ´Ðе¥Î»£¬²»¿ÉÄÜÓбÈËü¸üСµÄÖ´Ðе¥Î»£¬Òò´ËÕâÀïµÄÔ­×Óʵ¼ÊÊÇʹÓÃÁËÎïÀíѧÀïµÄÎïÖÊ΢Á£µÄ¸ÅÄî¡£
Ô­×Ó²Ù×÷ÐèÒªÓ²¼þµÄÖ§³Ö£¬Òò´ËÊǼܹ¹Ïà¹ØµÄ£¬ÆäAPIºÍÔ­×ÓÀàÐ͵Ķ¨Ò嶼¶¨ÒåÔÚÄÚºËÔ´ÂëÊ÷µÄinclude/asm/atomic.hÎļþÖУ¬ËüÃǶ¼Ê¹Óûã±àÓïÑÔʵÏÖ£¬ÒòΪCÓïÑÔ²¢²»ÄÜʵÏÖÕâÑùµÄ²Ù×÷¡£
Ô­×Ó²Ù×÷Ö÷ÒªÓÃÓÚʵÏÖ×ÊÔ´¼ÆÊý£¬ºÜ¶àÒýÓüÆÊý(refcnt)¾ÍÊÇͨ¹ýÔ­×Ó²Ù×÷ʵÏֵġ£Ô­×ÓÀàÐͶ¨ÒåÈçÏ£º
typedef struct { volatile int counter; } atomic_t;
volatileÐÞÊÎ×ֶθæËßgcc²»Òª¶Ô¸ÃÀàÐ͵ÄÊý¾Ý×öÓÅ»¯´¦Àí£¬¶ÔËüµÄ·ÃÎʶ¼ÊǶÔÄÚ´æµÄ·ÃÎÊ£¬¶ø²»ÊǶԼĴæÆ÷µÄ·ÃÎÊ¡£
Ô­×Ó²Ù×÷API°üÀ¨£º
atomic_read(atomic_t * v);
¸Ãº¯Êý¶ÔÔ­×ÓÀàÐ͵ıäÁ¿½øÐÐÔ­×Ó¶Á²Ù×÷£¬Ëü·µ»ØÔ­×ÓÀàÐ͵ıäÁ¿vµÄÖµ¡£
atomic_set(atomic_t * v, int i);
¸Ãº¯ÊýÉèÖÃÔ­×ÓÀàÐ͵ıäÁ¿vµÄֵΪi¡£
void atomic_add(int i, atomic_t *v);
¸Ãº¯Êý¸øÔ­×ÓÀàÐ͵ıäÁ¿vÔö¼ÓÖµi¡£
atomic_sub(int i, atomic_t *v);
¸Ãº¯Êý´ÓÔ­×ÓÀàÐ͵ıäÁ¿vÖмõÈ¥i¡£
int atomic_sub_and_test(int i, atomic_t *v);
¸Ãº¯Êý´ÓÔ­×ÓÀàÐ͵ıäÁ¿vÖмõÈ¥i£¬²¢ÅжϽá¹ûÊÇ·ñΪ0£¬Èç¹ûΪ0£¬·µ»ØÕ棬·ñÔò·µ»Ø¼Ù¡£
void atomic_inc(atomic_t *v);
¸Ãº¯Êý¶ÔÔ­×ÓÀàÐͱäÁ¿vÔ­×ÓµØÔö¼Ó1¡£
void atomic_dec(atomic_t *v);
¸Ãº¯Êý¶ÔÔ­×ÓÀàÐ͵ıäÁ¿vÔ­×ӵؼõ1¡£
int atomic_dec_and_test(atomic_t *v);
¸Ãº¯Êý¶ÔÔ­×ÓÀàÐ͵ıäÁ¿vÔ­×ӵؼõ1£¬²¢ÅжϽá¹ûÊÇ·ñΪ0£¬Èç¹ûΪ0£¬·µ»ØÕ棬·ñÔò·µ»Ø¼Ù¡£
int atomic_inc_and_test(atomic_t *v);
¸Ãº¯Êý¶ÔÔ­×ÓÀàÐ͵ıäÁ¿vÔ­×ÓµØÔö¼Ó1£¬²¢ÅжϽá¹ûÊÇ·ñΪ0£¬Èç¹ûΪ0£¬·µ»ØÕ棬·ñÔò·µ»Ø¼Ù¡£
int atomic_add_negative(int i, atomic_t *v);
¸


Ïà¹ØÎĵµ£º

linux httpd.confÎļþÅäÖÃÏê½â

httpd.confÎļþÅäÖÃÏê½â
ApacheµÄ»ù±¾ÉèÖÃÖ÷Òª½»ÓÉhttpd.confÀ´É趨¹ÜÀí£¬ÎÒÃÇÒªÐÞ¸ÄApacheµÄÏà¹ØÉ趨£¬Ö÷Òª»¹ÊÇͨ¹ýÐÞ¸Ähttpd.congÀ´ÊµÏÖ¡£ÏÂÃæÈÃÎÒÃÇÀ´¿´¿´httpd.confµÄÄÚÈÝ£¬ËüÖ÷Òª·Ö³É3´ó²¿·Ö£º
Section 1:Global Environment
Section 2:'Main' server configuration
Section 3:Virtual Hosts
¡¾µÚÒ»²¿·Ö¡¿
&mid ......

ÉÏ´óѧʱ×öµÄlinuxÉÏÊÓƵ´«ÊäµÄ³ÌÐò


Ô´ÎÄÀ´×Ôhttp://blog.csdn.net/dog0138/archive/2007/03/23/1539277.aspx
C/S ¼Ü¹¹ ³ÌÐòºÜ´óÒÔ²¿·ÖÐÞ¸Ä×ÔSPCAVIEW  ¼ÓÈëÁËXVID±à½âÂëºÍJRTP´«Êä  ÐèÒª°²×°ÏàÓ¦µÄ¿â ÁíÍâÉãÏñÍ·ÓõÄÖÐÐÇ΢µç×ӵĠ ËùÒÔ Çý¶¯×îºÃ×°ÄǸöÍòÄÜÇý¶¯  ÔÚÒ»¸ö¹úÍâÍøÕ¾ÉÏϵĠ Íü¼ÇÊÇʲôÁË ºÃÏñ½ÐSPCAXX 
Ö» ......

linux ½ø³Ì¼ä¹²ÏíÄÚ´æ

¿ÉÒÔ²ÉÓÃsysVµÄshmget £« shmat ʵÏÖ¡£
µ«ÊÇÎÒ¸üϲ»¶shm_open + mmap ¸ü¼òµ¥¡£
#---------------------writer.c----------------------------
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h> ......

Ò»¸öLinuxÏÂCÏ̳߳صÄʵÏÖ

from:×ÞöεÄרÀ¸
    ʲôʱºòÐèÒª´´½¨Ï̳߳ØÄØ£¿¼òµ¥µÄ˵£¬Èç¹ûÒ»¸öÓ¦ÓÃÐèҪƵ·±µÄ´´½¨ºÍÏú»ÙỊ̈߳¬¶øÈÎÎñÖ´ÐеÄʱ¼äÓַdz£¶Ì£¬ÕâÑùÏ̴߳´½¨ºÍÏú»ÙµÄ´øÀ´µÄ¿ªÏú¾Í²»ÈݺöÊÓ£¬ÕâʱҲÊÇÏ̳߳ظóö³¡µÄ»ú»áÁË¡£Èç¹ûÏ̴߳´½¨ºÍÏú»Ùʱ¼äÏà±ÈÈÎÎñÖ´ÐÐʱ¼ä¿ÉÒÔºöÂÔ²»¼Æ£¬ÔòûÓбØҪʹÓÃÏ̳߳ØÁË¡£
  &n ......

linuxÏÂÊý¾Ý¿â°²×°Ïêϸ½éÉÜ

Ò»¡¢²é¿´ÒªÇóµÄ×°Åä°ü£¨ºÍRHELËÄÓÐЩС²î±ð£©
rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common libstdc++ libstdc++-devel make ksh sysstat libaio openmotif22 libXp
rpm -ivh compat-db
rpm -ivh kernel-headers
rpm -ivh glibc-headers
rpm -ivh glibc-devel
rpm -ivh libgomp
rpm -i ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ