Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linuxỊ̈߳¨×ª£©

 ³ÌÏà¹Øº¯Êý£º
     pthread_attr_init()
     pthread_attr_setschedpolicy()
     pthread_attr_setschedparam()
     pthread_attr_destroy()
¾ßÌåÓ¦ÓÃdemo£º
pthread_attr_init(&attr);
pthread_attr_setschedpolicy(&attr, SCHED_RR);
pthread_attr_getschedparam(&attr, &param);
param.sched_priority=20;
pthread_attr_setschedparam(&attr, &param);
pthread_create(&tid, &attr, (void *)myfunction, myarg);
linux½ø³Ìµ÷¶È·½·¨(SCHED_OTHER,SCHED_FIFO,SCHED_RR)
linux½ø³Ìµ÷¶È·½·¨(SCHED_OTHER,SCHED_FIFO,SCHED_RR)
 linuxÄں˵ÄÈýÖÖµ÷¶È·½·¨£º
1£¬SCHED_OTHER ·Öʱµ÷¶È²ßÂÔ£¬
2£¬SCHED_FIFOʵʱµ÷¶È²ßÂÔ£¬Ïȵ½ÏÈ·þÎñ
3£¬SCHED_RRʵʱµ÷¶È²ßÂÔ£¬Ê±¼äƬÂÖת
linuxÄں˵ÄÈýÖÖµ÷¶È·½·¨£º
1£¬SCHED_OTHER ·Öʱµ÷¶È²ßÂÔ£¬
2£¬SCHED_FIFOʵʱµ÷¶È²ßÂÔ£¬Ïȵ½ÏÈ·þÎñ
3£¬SCHED_RRʵʱµ÷¶È²ßÂÔ£¬Ê±¼äƬÂÖת
 
ʵʱ½ø³Ì½«µÃµ½ÓÅÏȵ÷Óã¬ÊµÊ±½ø³Ì¸ù¾ÝʵʱÓÅÏȼ¶¾ö¶¨µ÷¶ÈȨֵ£¬·Öʱ½ø³ÌÔòͨ¹ýniceºÍcounterÖµ¾ö¶¨È¨Öµ£¬niceԽС£¬counterÔ½´ó£¬±»µ÷¶ÈµÄ¸ÅÂÊÔ½´ó£¬Ò²¾ÍÊÇÔø¾­Ê¹ÓÃÁËcpu×îÉٵĽø³Ì½«»áµÃµ½ÓÅÏȵ÷¶È¡£
 
SHCED_RRºÍSCHED_FIFOµÄ²»Í¬£º
     µ±²ÉÓÃSHCED_RR²ßÂԵĽø³ÌµÄʱ¼äƬÓÃÍ꣬ϵͳ½«ÖØзÖÅäʱ¼äƬ£¬²¢ÖÃÓÚ¾ÍÐ÷¶ÓÁÐβ¡£·ÅÔÚ¶ÓÁÐβ±£Ö¤ÁËËùÓоßÓÐÏàͬÓÅÏȼ¶µÄRRÈÎÎñµÄµ÷¶È¹«Æ½¡£   
    SCHED_FIFOÒ»µ©Õ¼ÓÃcpuÔòÒ»Ö±ÔËÐС£Ò»Ö±ÔËÐÐÖ±µ½Óиü¸ßÓÅÏȼ¶ÈÎÎñµ½´ï»ò×Ô¼º·ÅÆú¡£
    Èç¹ûÓÐÏàͬÓÅÏȼ¶µÄʵʱ½ø³Ì£¨¸ù¾ÝÓÅÏȼ¶¼ÆËãµÄµ÷¶ÈȨֵÊÇÒ»ÑùµÄ£©ÒѾ­×¼±¸ºÃ£¬FIFOʱ±ØÐëµÈ´ý¸Ã½ø³ÌÖ÷¶¯·ÅÆúºó²Å¿ÉÒÔÔËÐÐÕâ¸öÓÅÏȼ¶ÏàͬµÄÈÎÎñ¡£¶øRR¿ÉÒÔÈÃÿ¸öÈÎÎñ¶¼Ö´ÐÐÒ»¶Îʱ¼ä¡£
Ïàͬµã£º
    RRºÍFIFO¶¼Ö»ÓÃÓÚʵʱÈÎÎñ¡£
    ´´½¨Ê±ÓÅÏȼ¶´óÓÚ0(1-99)¡£
    °´ÕÕ¿ÉÇÀÕ¼ÓÅÏȼ¶µ÷¶ÈËã·¨½øÐС£
    ¾ÍÐ÷̬µÄʵʱÈÎÎñÁ¢¼´ÇÀÕ¼·ÇʵʱÈÎÎñ¡£
 
ËùÓÐÈÎÎñ¶¼²ÉÓÃlinux·Öʱµ÷¶È²ßÂÔʱ¡£
1£¬´´½¨ÈÎÎñÖ¸¶¨²ÉÓ÷Öʱµ÷¶È²ßÂÔ£¬²¢Ö¸¶¨ÓÅÏȼ¶niceÖµ(-20~19)¡£
2£¬½«¸ù¾Ýÿ¸öÈÎÎñµÄniceֵȷ¶¨ÔÚcpuÉϵÄÖ´ÐÐʱ¼ä(counter)¡£
3£¬Èç¹ûûÓеȴý×ÊÔ´£¬Ô


Ïà¹ØÎĵµ£º

£ÛתÌù£ÝLinuxÎļþ²éÕÒÃüÁîfind,xargsÏêÊö

×ܽ᣺
zhy2111314
À´×Ô£º
LinuxSir.Org
ÕûÀí£º
±±ÄÏÄϱ±
ͻ񻣼
±¾ÎÄÊÇfind ÃüÁîµÄÏêϸ˵Ã÷£¬¿É¹óµÄÊÇÕë¶Ô²ÎÊý¾ÙÁ˺ܶàµÄʵÀý£¬´óÁ¿µÄÀýÖ¤£¬ÈóõѧÕ߸üΪÈÝÒ×Àí½â£»±¾ÎÄÊÇzhyflyÐÖÌùÔÚÂÛ̳ÖУ»ÎÒ¶Ô±¾ÎĽøÐÐÁËÔÙ´ÎÕûÀí£¬Îª·½±ã´ó¼ÒÔĶÁ£»
Ŀ¼
°æȨÉùÃ÷
Ç°ÑÔ£º¹ØÓÚfindÃüÁî
Ò»¡¢find ÃüÁî¸ñʽ
1¡¢findÃüÁîµÄÒ» ......

ʵսLinux Bluetooth±à³Ì£¨¶þ£© BlueZ¼ò½é

LinuxÏÂBluetoothЭÒéÕ»µÄʵÏÖ. LinuxÏ¿ª·ÅµÄÀ¶ÑÀЭÒéÕ»Ö÷Òª°üÀ¨IBM¹«Ë¾µÄBlueDrekar£¬Nokia¹«Ë¾µÄAffix, Axis¹«Ë¾µÄOpenBTºÍ¹Ù·½Ð­ÒéÕ»BlueZ¡£ÎÒÃÇÖ÷ÒªÃæ¶ÔBluezÀ´Ì½ÌÖ¡£
BlueZ»ù´¡´úÂë¾ùÊÇÓÉMaxim KrasnyanskyÍê³ÉµÄ¡£°üÀ¨£ºHCI£¬L2CAP£¬RFCOMMºÍ»ù±¾socketµÄʵÏÖ¡£Ëû¾ÍÖ°ÓÚQualcomm(¸ßͨ)¡£Marcel Holtmann¿ª·¢²ãµÄÐ­Ò ......

ʵսLinux Bluetooth±à³Ì(Áù) L2CAP±à³ÌʵÀý

ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
 Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......

linuxÉ豸Çý¶¯³ÌÐò——×Ö·ûÉ豸Çý¶¯³ÌÐò

ÔÚLinux²Ù×÷ϵͳÏÂÓÐ3ÀàÖ÷ÒªµÄÉ豸ÎļþÀàÐÍ£º¿éÉ豸¡¢×Ö·ûÉ豸ºÍÍøÂçÉ豸¡£ÕâÖÖ·ÖÀà·½·¨¿ÉÒÔ½«¿ØÖÆÊäÈë/Êä³öÉ豸µÄÇý¶¯³ÌÐòÓëÆäËû²Ù×÷ϵͳÈí¼þ·ÖÀ뿪À´¡£×Ö·ûÉ豸ÊÇÖ¸´æȡʱûÓлº´æµÄÉ豸¡£µäÐ͵Ä×Ö·ûÉ豸°üÀ¨Êó±ê¡¢¼üÅÌ¡¢´®Ðпڵȡ£
×Ö·ûÉ豸Óë¿éÉ豸µÄÖ÷ÒªÇø±ðÊÇ£ºÔÚ¶Ô×Ö·ûÉ豸·¢³ö¶Á/дÇëÇóʱ£¬Êµ¼ÊµÄÓ²¼þI/OÒ»°ã½ô½Ó× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ