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
Ïà¹ØÎĵµ£º
ÔÚlinuxÏ£¬¹À¼ÆÄã¾³£Ê¹ÓÃpwdÕâ¸öÃüÁÕâ¸öÃüÁî¾ÍÊÇ´òÓ¡µ±Ç°µÄ¹¤×÷·¾¶£¬¼´print working directroy, ½ñÌìÎÒÃÇÒ²À´cÓïÑÔʵÏÖÕâ¸öÃüÁî¡£
ҪʵÏÖÕâ¸ö¹¦ÄÜ£¬ÐèÒªÓõ½ÏÂÃæµÄÒ»¸öϵͳµ÷Óãº
#include <unistd.h>
char *getcwd(char *buf, size_t size);
¸Ãϵͳµ÷Ó÷µ»Øµ±Ç°µÄ¹¤×÷Ŀ¼µÄ¾ø¶Ô·¾¶£¬¾ø¶Ô·¾¶ ......
Ê×ÏÈÎҵIJÙ×÷ϵͳÊÇDebian Linux£¬ÎÒDebianÓõÄÊÇXfce×ÀÃæ»·¾³£¬×òÌìÎÒÓÃÁËÃüÁîapt-get install gnome,°²×°ÁËÒ»¶ÑÈí¼þÖ®ºóÖØÆô£¬¾Í½øÈë²»ÁËͼÐνçÃæÁË£¬Ö»ÄܽøÈë×Ö·û½çÃæ£¬½ñÌì¿ÉºÃÕÛÌÚÁË¡£
¡¡¡¡ÉÏÎçÔÚÍøÉϲé×ÊÁÏ£¬¿ÉÄÜ×ܽáÁ˼¸¸ö°É
¡¡¡¡1¡¢ÔÚ×Ö·û½çÃæÊäÈëÃüÁîstartx
¡¡¡¡2¡¢ÐÞ¸ÄinitµÄĬÈϼ¶£¬ËùÔÚÎļþµÄλÖÃ/etc/initt ......
ʵÑé3 LinuxµÄ½ø³Ì¿ØÖÆ
Ò».ʵÑéÄ¿µÄ
ͨ¹ýʵÑéÕÆÎÕLinuxÖнø³Ì¿ØÖƵĻù±¾ÃüÁî¡£
¶þ.ʵÑéÒªÇó
1.Á·Ï°Ê¹ÓÃwho, w, ps,pstree²ì¿´ÏµÍ³Óû§¼°½ø³ÌµÄÐÅÏ¢¡£
2.Á·Ï°Ê¹ÓÃkillÃüÁî³·Ïú½ø³Ì¡£
3.Á·Ï°½ø³Ìǰºǫ́µÄÇл»¡£
Èý¡¢ ʵÑ鱨¸æÒªÇó
1£®   ......
ʵÑé4 Linux³ÌÐò¿ª·¢»ù´¡
Ò»¡¢ÊµÑéÄ¿µÄ£º
1. ¼ÌÐøÊìϤLinuxÖÕ¶ËÃüÁ
2. ¼ÌÐøÑ§Ï°Ê¹ÓÃVi±à¼Æ÷£»
3. ѧϰʹÓÃLinux»·¾³ÏÂCÓïÑÔ³ÌÐòµÄ±àÒë¡£
4. µ÷ÊÔÆ÷GdbµÄʹÓÃ
¶þ¡¢ÊµÑéÒªÇó£º
& ......
2005Äê9ÔÂ22ÈÕ£¬Ç廪ÔÚ¶Á²©Ê¿ÉúÍõÛóÔÚˮľÉçÇøBLOGÉÏ·¢±íÁË¡¶Ç廪ÃεķÛËé--д¸øÇ廪´óѧµÄÍËѧÉêÇë¡·Ã÷È·ÒªÇóÍËѧ, ÒýÆðÉç»á¸÷½ç¹ã·ºÕùÂÛ. Ëû´´×÷µÄ³¤ÆªÎÄÕ¡¶ÍêÈ«ÓÃLinux¹¤×÷¡·, ÑóÑóÁ½Íò¶à×Ö, ´Ó²»Í¬½Ç¶È¾Ó¸ßÁÙϵIJûÊöÁËËûÑÛÖÐLinuxÍêÈ«ÓÅÔ½ÓÚWindowsµÄ¸÷ÖÖÀíÓÉ, ÕâÆªÎÄÕ²¢²»¼òµ¥µÄÊÇһƪÂÛÊö"WindowsÄÜ×öµÄÊÂLinux¶¼Ä ......