LinuxµÄ¹¤×÷¶ÓÁÐ
1£¬ÏÈ¿´¿´¹¤×÷¶ÓÁкÍtaskletµÄÇø±ð£º
£¨1£© ¶¨Ê±Æ÷ºÍtasklet£º
Tasklets resemble kernel timers in 3 ways.
1)They are always run at interrupt time,
2)they always run on the same CPU that schedules them,
3)and they receive an unsigned long argument. Unlike kernel timers, however, you can’t ask to execute the function at a specific time.
£¨2£© taskletºÍ¹¤×÷¶ÓÁУº
Workqueues are, superficially, similar to tasklets; they allow kernel code to request that a function be called at some future time. There are, however, some significant differences between the two, including:
1) Tasklets run in software interrupt context with the result that all tasklet code must be atomic. Instead, workqueue functions run in the context of a special kernel process; as a result, they have more flexibility. In particular, workqueue functions can sleep.
2)Tasklets always run on the processor from which they were originally submitted. Workqueues work in the same way, by default.
3)Kernel code can request that the execution of workqueue functions be delayed for an explicit interval.
2£¬¹¤×÷¶ÓÁÐ(work queue)ÊÇLinux kernelÖн«¹¤×÷ÍÆºóÖ´ÐеÄÒ»ÖÖ»úÖÆ¡£ÕâÖÖ»úÖÆºÍBH»òTasklets²»Í¬Ö®´¦ÔÚÓÚ¹¤×÷¶ÓÁÐÊǰÑÍÆºóµÄ¹¤×÷½»ÓÉÒ»¸öÄÚºËÏß³ÌÈ¥Ö´ÐУ¬Òò´Ë¹¤×÷¶ÓÁеÄÓÅÊÆ¾ÍÔÚÓÚËüÔÊÐíÖØÐµ÷¶ÈÉõÖÁ˯Ãß¡£¹¤×÷¶ÓÁÐÊÇ2.6Äں˿ªÊ¼ÒýÈëµÄ»úÖÆ£¬ÔÚ2.6.20Ö®ºó£¬¹¤×÷¶ÓÁеÄÊý¾Ý½á¹¹·¢ÉúÁËһЩ±ä»¯£¬Òò´Ë±¾ÎÄ·Ö³ÉÁ½¸ö²¿·Ö¶Ô2.6.20֮ǰºÍÖ®ºóµÄ°æ±¾·Ö±ð×ö½éÉÜ¡£
£¨1£©2.6.0~2.6.19
Êý¾Ý½á¹¹£º
struct work_struct {
unsigned long pending;
struct list_head entry;
void (*func)(void *);
void *data
Ïà¹ØÎĵµ£º
¼ÙÈçÉÏ´«´úÂëµ½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
  ......
ÏÖÏó£ºÓÃSSHÈí¼þÁ¬½Óʱ£¬ÖÐÎÄÊÇÂÒÂë
½â¾ö£º
ÐÞ¸Ä/etc/sysconfig/i18nÎļþ£¬½«Æä¸Ä³ÉÒÔÏÂÄÚÈÝ£º
LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16" ......
LinuxÓ¦Ó÷¶Î§µÄÈÕÒæÀ©Õ¹£¬Ê¹µÃÆäʹÓÃÐÔÔ½À´Ô½Êܵ½¹Ø×¢¡£ÐÔÊÇÒ»¸ö¸´ÔӺ͹㷺µÄÎÊÌ⣬´Ë´¦ÎÒÃÇÖ÷Òª¹Ø×¢LinuxÓû§µÄÕË»§°²È«£¬ÌرðÊÇLinuxϵͳ¹ÜÀíÔ±ÈçºÎ±£ÕÏÓû§µÄ°²È«¡£
¡¡¡¡
¡¡¡¡
¡¡¡¡¿ÚÁȫ
¡¡¡¡
¡¡¡¡
¡¡¡¡LinuxϵͳÖеģ¯etc£¯passwdÎļþº¬ÓÐÈ«²¿ÏµÍ³ÐèÒªÖªµÀµÄÿ¸öÓû§µÄÐÅÏ¢(¼ÓÃÜ¿ÚÁîµÄÃÜÎÄÒ²¿ÉÄÜ´æÓÚ£¯etc£¯ ......
ʵÑé5 ½ø³Ì¹ÜÀí
Ò»¡¢ÊµÑéÄ¿µÄ£º
1. ÁË½â½ø³ÌÓë³ÌÐòµÄÇø±ð£¬¼ÓÉî¶Ô½ø³Ì¸ÅÄîµÄÀí½â¼Ó£»
2£® ÕÆÎÕ½ø³Ì²¢·¢Ö´ÐеÄÔÀí£¬¼°ÆäËùÒýÆðµÄͬ²½¡¢»¥³âÎÊÌâµÄ·½·¨
¶þ¡¢ÊµÑéÒªÇó£º
Íê³ÉʵÑéÄÚÈݲ¢Ð´³öʵÑ鱨¸æ£¬±¨¸æÓ¦¾ßÓÐÒÔÏÂÄÚÈÝ£º
1£® Ê ......
#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 interru ......