Linux Kernel API (2.6)
#protect share data
spin_lock/spin_unlock: protect the data during process context(and only at process context), and make sure your code bewteen lock/unlock is fast enough.There may deadlock if the same spin_lock is called at interrupt context.
spin_lock_irq/spin_unlock_irq: call it during interrupt context, make sure the irq is on before calling this function, it will disable irq before accessing share data
spin_lock_irqsave/irqrestore: use at interrupt context, and will save/restort irq registers
The code between spin_lock**/spin_unlock** must not sleep.
The spin_lock** API is defined at include/linux/spinlock_api_up.h for UP architecture.
linux/kernel/spinlock.c is only for SMP.
mutex_lock/mutex_unlock: the similar with down/up, but more efficient
mutex_lock_interruptible: the simlilar with down_interruptiable, can be interruptiable by signal.(like CTRL-C)
the code beween mutex_lock and mutex_unlock can go to sleep
Ïà¹ØÎĵµ£º
ÖÁ´ËÂä±ÊÖ®¼Ê£¬Ç¡ÖÁLinuxÎÊÊÀ18ÖÜÄ꣬18ÄêµÄ³É³¤£¬ÈçÃÎËÆ»Ã£¬·çÓêÆÄ¶à£¬¸Ð¿®ÆÄ¶à¡£
ÓÌ×ÔÒäÆð¶àÄêÒÔǰһλǰ±²Ñµµ¼Ê±µÄóðÑÔ£º½ñÌìµÄ±ØÈ»ÕýÊÇÓÉ֮ǰһϵÁеÄżȻËù¾ö¶¨µÄ¡£¹ýÈ¥µÄijÄêijÔ£¬ÎÒżȻ³õʶLinux¾ÍÉíÏÝÆäÖУ¬ÖÁ½ñÈÔÕÒ²»µ½³öÈ¥µÄ·£¬¶øÕýÊÇÕâ´ÎÄËÖÁÖ®ºóµÄ¶à´ÎżȻÏàÁªºÏ£¬´Ó¶ø¾ö¶¨Á˽ñÈÕµÄÎÒÒªÔÚ´ËдÏÂÕâЩ»°¡£ÄÇô ......
LinuxÎļþÃûµÄ³¤¶ÈÏÞÖÆÊÇ255¸ö×Ö·û
windowsÏÂÍêÈ«ÏÞ¶¨ÎļþÃû±ØÐëÉÙÓÚ260¸ö×Ö·û£¬Ä¿Â¼Ãû±ØÐëСÓÚ248¸ö×Ö·û¡£
linuxÏÂÎļþÊý¡¢Ä¿Â¼Êý¡¢ÎļþÃû³¤¶ÈµÄ¸÷ÖÖÏÞÖÆ
ÒÔϲâÊÔ¶¼ÊÇÔÚûÓÐÓÅ»¯»òÐÞ¸ÄÄں˵ÄǰÌáϲâÊԵĽá¹û
1. ²âÊÔÄ¿µÄ£ºext3ÎļþϵͳÏÂfilename×î´ó×Ö·û³¤¶È
²âÊÔÆ½Ì¨£ºRHEL5U3_x64
²âÊÔ¹ý³Ì£º
L ......
LinuxÓ¦Ó÷¶Î§µÄÈÕÒæÀ©Õ¹£¬Ê¹µÃÆäʹÓÃÐÔÔ½À´Ô½Êܵ½¹Ø×¢¡£ÐÔÊÇÒ»¸ö¸´ÔӺ͹㷺µÄÎÊÌ⣬´Ë´¦ÎÒÃÇÖ÷Òª¹Ø×¢LinuxÓû§µÄÕË»§°²È«£¬ÌرðÊÇLinuxϵͳ¹ÜÀíÔ±ÈçºÎ±£ÕÏÓû§µÄ°²È«¡£
¡¡¡¡
¡¡¡¡
¡¡¡¡¿ÚÁȫ
¡¡¡¡
¡¡¡¡
¡¡¡¡LinuxϵͳÖеģ¯etc£¯passwdÎļþº¬ÓÐÈ«²¿ÏµÍ³ÐèÒªÖªµÀµÄÿ¸öÓû§µÄÐÅÏ¢(¼ÓÃÜ¿ÚÁîµÄÃÜÎÄÒ²¿ÉÄÜ´æÓÚ£¯etc£¯ ......
ʵÑé4 Linux³ÌÐò¿ª·¢»ù´¡
Ò»¡¢ÊµÑéÄ¿µÄ£º
1. ¼ÌÐøÊìϤLinuxÖÕ¶ËÃüÁ
2. ¼ÌÐøÑ§Ï°Ê¹ÓÃVi±à¼Æ÷£»
3. ѧϰʹÓÃLinux»·¾³ÏÂCÓïÑÔ³ÌÐòµÄ±àÒë¡£
4. µ÷ÊÔÆ÷GdbµÄʹÓÃ
¶þ¡¢ÊµÑéÒªÇó£º
& ......
2005Äê9ÔÂ22ÈÕ£¬Ç廪ÔÚ¶Á²©Ê¿ÉúÍõÛóÔÚˮľÉçÇøBLOGÉÏ·¢±íÁË¡¶Ç廪ÃεķÛËé--д¸øÇ廪´óѧµÄÍËѧÉêÇë¡·Ã÷È·ÒªÇóÍËѧ, ÒýÆðÉç»á¸÷½ç¹ã·ºÕùÂÛ. Ëû´´×÷µÄ³¤ÆªÎÄÕ¡¶ÍêÈ«ÓÃLinux¹¤×÷¡·, ÑóÑóÁ½Íò¶à×Ö, ´Ó²»Í¬½Ç¶È¾Ó¸ßÁÙϵIJûÊöÁËËûÑÛÖÐLinuxÍêÈ«ÓÅÔ½ÓÚWindowsµÄ¸÷ÖÖÀíÓÉ, ÕâÆªÎÄÕ²¢²»¼òµ¥µÄÊÇһƪÂÛÊö"WindowsÄÜ×öµÄÊÂLinux¶¼Ä ......