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

linuxÇý¶¯±à³ÌºËÐÄÀíÂÛÖ®²¢·¢¿ØÖÆ

Çý¶¯±à³ÌºËÐÄÀíÂÛÖ®²¢·¢¿ØÖÆ
²¢·¢£¬¾¹Ì¬µÄÀí½â£ºÒ²¾ÍÊÇLinuxµÄ¶«Î÷ÔÚʱ¼äºÍ¿Õ¼ä±»Í¬Ê±Ê¹Óõ¼ÖµÄÎÊÌâ
LinuxϵͳÌṩµÄ½â¾ö·½°¸£º
    ÖмÌÆÁ±Î
    Ô­×Ó²Ù×÷
    ×ÔÐýËø
    ÐźÅÁ¿
   
1,ÖжÏÆÁ±Î
    Ê×ÏÈÕâ¸öÒÀÀµÓÚCPU£¬CPUÒ»°ãÌṩÆÁ±ÎÖжϵĴò¿ªÖжϵŦÄÜ,ÖжÏÆÁ±ÎʹµÃÖжϺͽø³ÌÖ®¼äµÄ²¢·¢
    ²»ÔÙ·¢Éú£¬Í¬Ê±½ø³Ìµ÷ÊÔÒ²ÒÀÀµÓÚÖжϣ¬ÄÚºËÇÀÕ¼µÄ½ø³Ì¼ä²¢·¢Ò²¾Í¿ÉÒÔ±ÜÃâ
   
    ʹÓ÷½·¨
    local_irq_disable()//ÆÁ±ÎÖжÏ
    ...
    critical section()//ÁÙ½çÇø
    ...
    local_irq_enable()//´ò¿ªÖжÏ
    ÕâÖÖ·½·¨Ö»Äܽâ¾öµ¥¸öCPUµÄÎÊÌâ
   
    ×¢Òâ £º ³¤Ê±¼äÖжÏÆÁ±ÎºÜΣÏÕ£¬±È½ÏÊʺϺÍ×ÔÐýËøÁªºÏʹÓÃ
    local_irq_save(flags)    ½ûÖ¹ÖжÏͬʱ±£´æÄ¿Ç°CPUµÄÖжÏÐÅϢλ
    local_irq_restore(flags) ´ò¿ªÖжÏͬʱ»Ö¸´ÖжÏÐÅϢλ
    µ×°ë²¿²Ù×÷
    local_bh_disable()
    local_bh_enable()
   
2,Ô­×Ó²Ù×÷
    Ô­×Ó²Ù×÷ÊÇÖ¸ÔÚÖ´Ðйý³ÌÖв»»á±»µÄ´úÂë·¾¶ËùÖжϵIJÙ×÷¡£´ýÀí½â
    ·ÖΪÁ½À࣬Õë¶ÔλµÄ²Ù×÷ºÍÕûÐͱäÁ¿µÄ²Ù×÷
   
    Õë¶ÔÕûÐͱäÁ¿µÄÔ­×Ó²Ù×÷µÄÏà¹Øº¯Êý
    void atomic_set(atomic_t *v, int i);//ÉèÖÃÔ­×Ó±äÁ¿µÄֵΪi
    atomic_t v = ATOMIC_INIT(0);//¶¨ÒåÔ­×Ó±äÁ¿v²¢³õʼ»¯Îª0
    atomic_read(atomic_t *v);//·µ»ØÔ­×Ó±äÁ¿µÄÖµ
    void atomic_add(int i, atomic_t *v);//Ô­×Ó±äÁ¿Ôö¼Ói
    void atomic_sub(int i, atomic_t *v);//Ô­×Ó±äÁ¿¼õÉÙi
    void atomic_inc(atomic_t *v);//Ô­×Ó±äÁ¿×ÔÔö¼Ó1
    void atomic_dec(atomic_t *v);//Ô­×Ó±äÁ¿×Ô¼õÉÙ1
    ²Ù×÷²¢²âÊÔº¯Êý
    int atomic_inc_and_test(atomic_t *v);
    int atomic_dec


Ïà¹ØÎĵµ£º

LinuxµÄDateºÍTime

ÖÜÐ÷ºê
http://zxuhong.blog.51cto.com/368977/74442
 
1.1 ¸ÅÊö
ÊÀ½ç±ê׼ʱ¼ä£¨Coordinated Universal Time£¬UTC£©£¬Ò²¾ÍÊÇ´ó¼ÒËùÊìÖªµÄ¸ñÁÖÍþÖαê׼ʱ ¼ä£¨Greenwich Mean Time£¬GMT£©¡£ÊÀ½ç¸÷µØʱ¼äÒ²ÊÀ½ç±ê׼ʱ¼äΪ»ù×¼»®·ÖΪ²»Í¬µÄʱÇø£¬ÀýÈ磬ÖйúµÄ±±¾©Ê±¼äÓëUTCµÄʱ²îΪ+8£¬Ò²¾ÍÊÇUTC+8¡£ÃÀ¹úÊÇUTC-5¡£
& ......

LINUXƽ̨²¿Êðapache+mod_python+django


ǰһƪÎÄÕÂдµÄÔÚAPACHE°²×°MOD_PYTHONµÄ¾­¹ý,Æäʵͦ¼òµ¥,¾ÍÊÇ°æ±¾²»¼æÈݵÄÎÊÌâ.Õâ´ÎÎÒ´ó¸Å˵ϲ¿ÊðDJANGOµÄ¹ý³Ì.
ÏÈÐÞ¸ÄAPACHEÅäÖÃÎļþ,ʹÆä¼ÓÔØmod_pythonÄ£¿é
LoadModule python_module libexec/mod_python.so
ÔËÐÐÃüÁî²é¿´
bin/httpd -M¿ÉÒÔ¿´µ½
 python_module (shared)
Syntax OK
˵Ã÷apacheÒѾ­³É¹¦¼Ó ......

LinuxÉ豸Ãûtty¡¢pty¡¢ptsµÄ¸ÅÄî

»ù±¾¸ÅÄ
1> tty(ÖÕ¶ËÉ豸µÄͳ³Æ):
ttyÒ»´ÊÔ´ÓÚTeletypes£¬»òteletypewriters£¬Ô­À´Ö¸µÄÊǵ紫´ò×Ö»ú£¬ÊÇͨ¹ý´®ÐÐÏßÓôòÓ¡»ú¼üÅÌͨ¹ýÔĶÁºÍ·¢ËÍÐÅÏ¢µÄ¶«Î÷£¬ºóÀ´ÕⶫÎ÷±»¼üÅ̺ÍÏÔʾÆ÷È¡´ú£¬ËùÒÔÏÖÔÚ½ÐÖն˱ȽϺÏÊÊ¡£
ÖÕ¶ËÊÇÒ»ÖÖ×Ö·ûÐÍÉ豸£¬ËûÓжàÖÖÀàÐÍ£¬Í¨³£Ê¹ÓÃttyÀ´¼ò³Æ¸÷ÖÖÀàÐ͵ÄÖÕ¶ËÉ豸¡£
2> pty£¨ÐéÄâÖ ......

LINUX ÎÒÓÀÔ¶µÄÍ´

¸Õ¸Õ´ÓÒ»¼ÒÖªÃûµÄɱ¶¾Èí¼þ¹«Ë¾´ÇÖ°¡£ÔÚÕâ¼Ò¹«Ë¾¸ÉÁËÒ»Äê°ë£¬ÍêÈ«ÊÇWINDOWSƽ̨µÄÓ¦Óÿª·¢£¬×ö²»ÍêµÄ½çÃæ¡¢ÅäÖá¢ÈÕÖ¾£¬¶¥¶àÔÙÀ´Ð©Êý¾Ý¿â½Ó¿Ú¿ª·¢¡£·¦Î¶¡£¡£ÎÞÁÄ¡£¡£²»¸ÉÁË£¡
ÆäʵÎÒ±¾À´¾Í²»¸ÃÀ´Õâ¼Ò¹«Ë¾¡£Ö®Ç°ÔÚÖØÇì×ö¹ýÁ½ÄêµÄÍøÂçÓÎÏ·¿ª·¢£¬À´±±¾©µ½Ê±ºò±¾Ïë¼ÌÐøÕâ·½Ãæ¡£Ö»ÊÇÔÚÕâ¼ÒÖªÃû¹«Ë¾ÓиöÊìÈ˰ѼòÀú¸øµÝ¹ýÈ¥ÁË£¬µ±Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ