Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÀïÌí¼Óɾ³ýÓû§ºÍ×飬²¢ÉèÖÃÓû§Ä¿Â¼

ѧµÄ¿ìÍüµÄÒ²¿ì£¬ºÃ£¬°ÑËü¼ÇÏÂÀ´¡£
(Ò») Óû§
1. ×÷ΪrootµÇ¼
2. ¸øÄãÒªÌí¼ÓµÄÓû§ÉèÖÃÓû§Ä¿Â¼£¬ mkdir /home/yang
3. useradd yang -g  users -G 100 -d /home/yang
-->Ö¸¶¨×éÓà -g£¬Òª²é¿´ÏµÍ³Ä¿Ç°ÓÐÄÄЩ×飬¿ÉÒÔ cat /etc/group
-->Èç¹û²»ÉèÖà -g, -d useradd½«Ê¹Óà /etc/default/useradd ½Å±¾Ö¸¶¨µÄ ......

Linux BlueZ Ï InquiryµÄʵÏÖ

Ç°Ãæ½²ÁËʹÓà ioctl·¢ËÍHCI CommandµÄ·½·¨¡£µ«HCI protocol»¹ÓÐһЩCommand£¬±ÈÈçInquiryµÈ£¬ËûÃÇÔò²»ÐèҪʹÓÃioctlÀ´·¢ËÍ¡£blueZ Ö±½ÓÌṩÁËÖ§³Ö£¬ËäÈ»ËûÃǵÄ×îÖÕ¶¼ÊÇÓÃͬÑù°ì·¨ÊµÏֵġ£
ÔÚÓ¦ÓóÌÐòÖУº
hci_inquiry(dev_id, length, num_rsp, NULL, &info, flags);
ÕâÑùÐèÒª°üº¬blueZ Í·ÎļþÈçÏ£º
#include //BT ......

ʵս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µÄºº»¯£¬ºÜ¼òµ¥
½øÈëÄãµÄxpϵͳÅÌ£¬È»ºó½øÈëwindows£¬½«ÄãµÄfontsÎļþ¼ÐÈ«²¿¸´ÖƵ½uÅÌÖУ¬½øÈëlinux£¬Ñ°ÕÒÄãµÄlinux×ÖÌåÔÚÄÇÀȻºó°ÑfontsµÄÄÚÈÝÈ«²¿¸´ÖƽøÈ¥
Èç¹û²»ÖªµÀlinuxµÄ×ÖÌåÔÚÄÄ£¿°´Èçϲ½Ö裺
½øÈëÖÕ¶Ë
ÊäÈë“locate £ª.ttf”£¨Èç¹ûlocate£¬²»ÄÜÓã¬ÊäÈë“updatedb”£¬»Ø³µ£¬µ ......

LinuxϹ²ÏíÎļþϵͳÎļþ´«ÊäµÄ¼òµ¥Éè¼Æ£¨×ªÔØ£©

¹²ÏíÎļþϵͳÎļþ´«Ê䣬ÊÇÍøÂçÕì¿ØÏîÄ¿ÖеÄÒ»¸öʵ¼Ê²Ù×÷¡£ËüÊÇΪÁ˵ÖÖÆÈëÇÖÕß½øÈëÄÚÍø¶øÌá³öµÄÒ»ÖÖ°²È«½â¾ö·½°¸¡£ÔÚʵ¼Ê´«Êä¹ý³ÌÖУ¬ÍØÆËͼÈçÏ£º
ʵ¼Ê»·¾³¾ùÔÚLinuxÖ÷»úϽøÐС£²ÉÓÃOCFS2Îļþ¼¯ÈºµÄ·½Ê½¡£ÍⲿÖ÷»úAºÍÄÚ²¿Ö÷»úBÖ®¼äµÄͨѶ£¬¾ùͨ¹ý¹²Ïí´æ´¢¿Õ¼äC½øÐнÓÊܺͷ¢ËÍ¡£ÕâÑù¼´Ê¹ÈëÇÖÕßÄÃÏÂÍⲿÖ÷»úA£¬Ò²ÎÞ·¨Éø͸ÄÚ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ