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
Ïà¹ØÎĵµ£º
¼ÙÈçÉÏ´«´úÂëµ½SVNÉÏ£¬×î¼òµ¥µÄÒ»ÖÖ·½·¨¾ÍÊÇ£º½øÈë´úÂëĿ¼£¬È»ºó$svn import -m "New import" myqwcode http://192.168.0.222/svn/myqwcode¾Í¿ÉÒÔÁË£¬²»ÐèÒª½¨Á¢ÐÂĿ¼£¡
1¡¢½«Îļþcheckoutµ½±¾µØÄ¿Â¼
svn checkout path£¨pathÊÇ·þÎñÆ÷ÉϵÄĿ¼£©
ÀýÈ磺svn checkout svn://192.168.1.1/pro/domain
  ......
ÔÚlinuxÏ£¬¹À¼ÆÄã¾³£Ê¹ÓÃpwdÕâ¸öÃüÁÕâ¸öÃüÁî¾ÍÊÇ´òÓ¡µ±Ç°µÄ¹¤×÷·¾¶£¬¼´print working directroy, ½ñÌìÎÒÃÇÒ²À´cÓïÑÔʵÏÖÕâ¸öÃüÁî¡£
ҪʵÏÖÕâ¸ö¹¦ÄÜ£¬ÐèÒªÓõ½ÏÂÃæµÄÒ»¸öϵͳµ÷Óãº
#include <unistd.h>
char *getcwd(char *buf, size_t size);
¸Ãϵͳµ÷Ó÷µ»Øµ±Ç°µÄ¹¤×÷Ŀ¼µÄ¾ø¶Ô·¾¶£¬¾ø¶Ô·¾¶ ......
ʵÑé3 LinuxµÄ½ø³Ì¿ØÖÆ
Ò».ʵÑéÄ¿µÄ
ͨ¹ýʵÑéÕÆÎÕLinuxÖнø³Ì¿ØÖƵĻù±¾ÃüÁî¡£
¶þ.ʵÑéÒªÇó
1.Á·Ï°Ê¹ÓÃwho, w, ps,pstree²ì¿´ÏµÍ³Óû§¼°½ø³ÌµÄÐÅÏ¢¡£
2.Á·Ï°Ê¹ÓÃkillÃüÁî³·Ïú½ø³Ì¡£
3.Á·Ï°½ø³Ìǰºǫ́µÄÇл»¡£
Èý¡¢ ʵÑ鱨¸æÒªÇó
1£®   ......
2005Äê9ÔÂ22ÈÕ£¬Ç廪ÔÚ¶Á²©Ê¿ÉúÍõÛóÔÚˮľÉçÇøBLOGÉÏ·¢±íÁË¡¶Ç廪ÃεķÛËé--д¸øÇ廪´óѧµÄÍËѧÉêÇë¡·Ã÷È·ÒªÇóÍËѧ, ÒýÆðÉç»á¸÷½ç¹ã·ºÕùÂÛ. Ëû´´×÷µÄ³¤ÆªÎÄÕ¡¶ÍêÈ«ÓÃLinux¹¤×÷¡·, ÑóÑóÁ½Íò¶à×Ö, ´Ó²»Í¬½Ç¶È¾Ó¸ßÁÙϵIJûÊöÁËËûÑÛÖÐLinuxÍêÈ«ÓÅÔ½ÓÚWindowsµÄ¸÷ÖÖÀíÓÉ, ÕâÆªÎÄÕ²¢²»¼òµ¥µÄÊÇһƪÂÛÊö"WindowsÄÜ×öµÄÊÂLinux¶¼Ä ......