linuxÇý¶¯Ä£¿é
¹¤×÷¶ÓÁУ¨work queue£©ÊÇÁíÍâÒ»ÖÖ½«¹¤×÷ÍƺóÖ´ÐеÄÐÎʽ £¬ËüºÍÎÒÃÇÇ°ÃæÌÖÂÛµÄËùÓÐÆäËûÐÎʽ¶¼Óв»Í¬¡£¹¤×÷¶ÓÁпÉÒ԰ѹ¤×÷Íƺ󣬽»ÓÉÒ»¸öÄÚºËÏß³ÌÈ¥Ö´ÐУ¬Ò²¾ÍÊÇ˵£¬Õâ¸öÏ°벿·Ö¿ÉÒÔÔÚ½ø³ÌÉÏÏÂÎÄÖÐÖ´ÐС£ÕâÑù£¬Í¨¹ý¹¤×÷¶ÓÁÐÖ´ÐеĴúÂëÄÜÕ¼¾¡½ø³ÌÉÏÏÂÎĵÄËùÓÐÓÅÊÆ¡£×îÖØÒªµÄ¾ÍÊǹ¤×÷¶ÓÁÐÔÊÐí±»ÖØе÷¶ÈÉõÖÁÊÇ˯Ãß¡£
ÄÇô£¬Ê²Ã´Çé¿öÏÂʹÓù¤×÷¶ÓÁУ¬Ê²Ã´Çé¿öÏÂʹÓÃtasklet¡£Èç¹ûÍƺóÖ´ÐеÄÈÎÎñÐèҪ˯Ãߣ¬ÄÇô¾ÍÑ¡Ôñ¹¤×÷¶ÓÁС£Èç¹ûÍƺóÖ´ÐеÄÈÎÎñ²»ÐèҪ˯Ãߣ¬ÄÇô¾ÍÑ¡Ôñtasklet¡£ÁíÍ⣬Èç¹ûÐèÒªÓÃÒ»¸ö¿ÉÒÔÖØе÷¶ÈµÄʵÌåÀ´Ö´ÐÐÄãµÄÏ°벿´¦Àí£¬Ò²Ó¦¸ÃʹÓù¤×÷¶ÓÁС£ËüÊÇΨһÄÜÔÚ½ø³ÌÉÏÏÂÎÄÔËÐеÄÏ°벿ʵÏֵĻúÖÆ£¬Ò²Ö»ÓÐËü²Å¿ÉÒÔ˯Ãß¡£ÕâÒâζ×ÅÔÚÐèÒª»ñµÃ´óÁ¿µÄÄÚ´æʱ¡¢ÔÚÐèÒª»ñÈ¡ÐźÅÁ¿Ê±£¬ÔÚÐèÒªÖ´ÐÐ×èÈûʽµÄI/O²Ù×÷ʱ£¬Ëü¶¼»á·Ç³£ÓÐÓá£Èç¹û²»ÐèÒªÓÃÒ»¸öÄÚºËÏß³ÌÀ´ÍƺóÖ´Ðй¤×÷£¬ÄÇô¾Í¿¼ÂÇʹÓÃtasklet¡£
1. ¹¤×÷¡¢¹¤×÷¶ÓÁк͹¤×÷ÕßÏß³Ì
ÈçÇ°ËùÊö£¬ÎÒÃÇ°ÑÍƺóÖ´ÐеÄÈÎÎñ½Ð×ö¹¤×÷£¨work£©£¬ÃèÊöËüµÄÊý¾Ý½á¹¹Îªwork_struct£¬ÕâЩ¹¤×÷ÒÔ¶ÓÁнṹ×éÖ¯³É¹¤×÷¶ÓÁУ¨workqueue£©£¬ÆäÊý¾Ý½á¹¹Îªworkqueue_struct£¬¶ø¹¤×÷Ï߳̾ÍÊǸºÔðÖ´Ðй¤×÷¶ÓÁÐÖеŤ×÷¡£ÏµÍ³Ä¬ÈϵŤ×÷ÕßÏß³ÌΪevents,×Ô¼ºÒ²¿ÉÒÔ´´½¨×Ô¼ºµÄ¹¤×÷ÕßÏ̡߳£
2. ±íʾ¹¤×÷µÄÊý¾Ý½á¹¹
¹¤×÷ÓÃ<linux/workqueue.h>Öж¨ÒåµÄwork_struct½á¹¹±íʾ£º
struct work_struct{
unsigned long pending; /* Õâ¸ö¹¤×÷ÕýÔڵȴý´¦ÀíÂð£¿*/
struct list_head entry; /* Á¬½ÓËùÓй¤×÷µÄÁ´±í */
void (*func) (void *); /* ÒªÖ´Ðеĺ¯Êý */
void *data; /* ´«µÝ¸øº¯ÊýµÄ²ÎÊý */
void *wq_data; /* ÄÚ²¿Ê¹Óà */
struct timer_list timer; &n
Ïà¹ØÎĵµ£º
2)Linux³ÌÐòÉè¼ÆÈëÃÅ--½ø³Ì½éÉÜ
LinuxϽø³ÌµÄ´´½¨
Ç°ÑÔ:
ÕâƪÎÄÕÂÊÇÓÃÀ´½éÉÜÔÚLinuxϺͽø³ÌÏà¹ØµÄ¸÷¸ö¸ÅÄî.ÎÒÃǽ«»áѧµ½:
½ø³ÌµÄ¸ÅÄî
½ø³ÌµÄÉí·Ý
½ø³ÌµÄ´´½¨
ÊØ»¤½ø³ÌµÄ´´½¨
----------------------------------------------------------------------------
----
1¡£½ø³ÌµÄ¸ÅÄî
Linux²Ù×÷ϵͳÊÇÃæÏ ......
3)Linux³ÌÐòÉè¼ÆÈëÃÅ--Îļþ²Ù×÷
LinuxÏÂÎļþµÄ²Ù×÷
Ç°ÑÔ:
ÎÒÃÇÔÚÕâÒ»½Ú½«ÒªÌÖÂÛlinuxÏÂÎļþ²Ù×÷µÄ¸÷¸öº¯Êý.
ÎļþµÄ´´½¨ºÍ¶Áд
ÎļþµÄ¸÷¸öÊôÐÔ
Ŀ¼ÎļþµÄ²Ù×÷
¹ÜµÀÎļþ
----------------------------------------------------------------------------
----
1¡£ÎļþµÄ´´½¨ºÍ¶Áд
ÎÒ¼ÙÉèÄãÒѾ֪µÀÁ˱ ......
6)Linux³ÌÐòÉè¼ÆÈëÃÅ--ÏûÏ¢¹ÜÀí
Ç°ÑÔ:LinuxϵĽø³ÌͨÐÅ(IPC)
LinuxϵĽø³ÌͨÐÅ(IPC)
POSIXÎÞÃûÐźÅÁ¿
System VÐźÅÁ¿
System VÏûÏ¢¶ÓÁÐ
System V¹²ÏíÄÚ´æ
1¡£POSIXÎÞÃûÐźÅÁ¿ Èç¹ûÄãѧϰ¹ý²Ù×÷ϵͳ,ÄÇô¿Ï¶¨ÊìϤPV²Ù×÷ÁË.PV²Ù×÷ÊÇÔ×Ó
²Ù×÷.Ò²¾ÍÊDzÙ×÷ÊDz»¿ÉÒÔÖжϵÄ,ÔÚÒ»¶¨µÄʱ¼äÄÚ,Ö»Äܹ»ÓÐÒ»¸ö½ø³ÌµÄ´ ......
LinuxÏ»ñµÃϵͳʱ¼äµÄCÓïÑÔµÄʵÏÖ·½·¨
#include<time.h> //CÓïÑÔµÄÍ·Îļþ
#include<stdio.h> //C﵀I/O
void main()
{
time_t now; //ʵÀý»¯time_t½á¹¹
struct tm *timenow; //ʵÀý»¯tm½á¹¹Ö¸Õë
time(&now);
//timeº¯Êý¶ÁÈ¡ÏÖÔÚµ ......
ΪÁ˸üºÃµÄ½â¾öÐéÄâ»úÓëÖ÷»úµÄ¹²ÏíÎÊÌ⣬VMware¹«Ë¾ÓÐÒ»¸öVMWare£tools£¬À´ÊµÏÖÎļþ¹²Ïí¡£ÕâÀïÖ÷Òª½²µÄÊÇÔÚWindowsÏÂÓà VmwareÐéÄâLinuxÀ´ÓëwindowsÀ´¹²Ïí¡£
¡¡¡¡1¡¢°²×°¿Í»§»úϵͳ£¬linuxÕâÀïÑ¡ÓÃCentOS5
¡¡¡¡2¡¢Æô¶¯ÐéÄâ»úÖеÄLinuxºó£¬£¨×¢Òâ±ØÐëÊÇÆô¶¯ÐéÄâ»úºó£©¡£Ñ¡Ôñ²Ëµ¥ÀïµÄVMÑ¡ÏÀïÃæÓÐÒ»¸ö×ÓÏîÊÇInstall VM ......