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

LINUX SOCKET AIO ÎÊÌâ

дÁË´úÂ룬ʹÓÃace_proactor, Ô­À´windowsÅܵ÷dz£Æ¯ÁÁ£¬À´µ½linux¾Íʱ²»Ê±²»¹¤×÷£¬È»ºó¼Óasynce_connectorºó£¬·¢ÏÖÍê³É²»Äܹ¤×÷£¬async_stream_writeºó£¬·¢ÏÖ¿¨ÔÚÄÇÀ¸ù±¾·¢²»³öÈ¥£¬¶à´Î·ÖÎöºó£¬·¢ÏÖ£¬Ô­À´Ö®Ç°ÓÐaio_readûÓÐÍê³É£¬aio_writeµÄÇëÇó¾ÍblockÄÇÀïÁË£¬writeÕâ¸ö²Ù×÷¾¹È»Ò»¶¨ÒªµÈÇ°µÄaio_readÍê³ÉÖ®ºó£¬²Å¿ÉÒÔÖ´ÐС£ Ö¤¾ÝÈçÏÂ:
1.¿¨×¡µÄaio_write »á³ÉÉÏÍê³É£¬Èç¹ûsocket±»¶Ô·½¹Ø±Õ¡£
2.ÔÚaio_read֮ǰÉèÖÃsocketµÄģʽΪnonblocking, һʱwrite²Ù×÷³öÏÖ£¬aio_read ÂíÉÏÍê³É£¬²¢·µ»Ø´íÎóÂë EAGAIN£¬È»ºóaio_writeµÄÇëÇóÒ²¸øÍê³ÉÁË¡£
3.socketµÄģʽÔÚaceºÍIBMÓйصÄaioÎĵµÖиøÇ¿µ÷£¬must be ing blocking mode.
Ìì°¡£¡
³¢ÊÔÁËÔÚaio_write֮ǰÈç¹ûÓжÁ²Ù×÷£¬Ê¹ÓÃaio_cancel½øÐÐcancel²Ù×÷£¬²»ÐУ¬ÓÚÊÇÉèÖÃÁËnonblockingģʽȻºó¶øcancel£¬»¹ÊÇûÓÐÈκη´Ó¦¡£
¿´À´LINUXµÄAIOʵÏÖÕæÊǹ»Àõģ¬¶ÔÓÚSOCKET²Ù×÷µÄʵÏÖÍêȫʧ°Ü£¡
¼ÙÉèÒÔÏÂÇéÐΣº
1.server ¹ã²¥Êý¾Ý¸ø¿Í»§¶Ë£¨µ÷ÓÃaio_write)£¬²¢ÇÒ·¢ËÍÁËÒ»ÌõÆÚÍûµÃµ½¿Í»§¶ËÏìÓ¦µÄÖ¸Áî(aio_read)£¬½á¹û¿Í»§¶Ë³¤ÆÚûÓÐÏìÓ¦£¬ÕâʱÎÒÏëÔÙ·¢Ò»Ìõ֪ͨÊý¾Ý¸ø¿Í»§¶Ë(µ÷ÓÃaio_write)£¬Õâ¸ö·¢Ë͵ÄÇëÇó¾Í¸øÄÚºËÀïblockסÔÚÄÇÀһֱ·¢²»³öÈ¥£¬ÒòΪËüÒªµÈÇ°ÃæÒ»¸öaio_readÍê³É, Ö±µ½¿Í»§¶ËÏìÓ¦ÁË»òÕßÊǶÏÏßÁË£¬ÕâµÚ¶þ¸öaio_write²Å»áÍê³É¡£
ÓôÃÆ°É¡£²¢ÇÒÄãÎÞ·¨È¡ÏûÕâÖÖ״̬£¬Õâ¸ösocket ¾ÍÍ£ÔÚÄÇÀïÁË¡£¡£¡£¡£
¶ÔÓÚserver¶ËÕâ¸ö»¹ºÃ¡£
Èç¹ûÄãµÄserver¶ËÓÖÐèÒªºÍÆäËüserver×÷ÁªÏµµÄʱºò£¬Äã¾ÍÂé·³ÁË£¬ÍêÈ«²»¿ÉÔ¤²â¡£


Ïà¹ØÎĵµ£º

LinuxÖжϴ¦ÀíÖ®Ò»(¹²ÏíÖжϴ¦Àí³õ̽)

      ÔÚ¿´LKD(µÚ¶þ°æ)µÚÁùÕÂ(ÖжϺÍÖжϴ¦Àí³ÌÐò)µÄʱºò£¬¸Õ¿ªÊ¼½Ó´¥µ½ÖжÏÏߺź͹²ÏíÖжÏÏßµÄʱºò°ëÌìã¶ÊÇûÓÐÏëÃ÷°×£¬Ô­À´Àí½âµÄÖжϺÍÖжϺÍÖжϴ¦Àí³ÌÐò¾ÍÊÇͨ¹ýÖжÏÏߺÅÀ´½øÐйØÁª£¬Ó²¼þ·¢ÉúÖжϣ¬È»ºóͨ¹ýÖжÏÏߺŲéÕÒ¶ÔÓ¦µÄÖжϴ¦Àí³ÌÐò£¬×îºóÖжϴ¦Àí³ÌÐò·µ»Ø£¬´Ë´ÎÖжÏÔò´¦ÀíÍê±Ï£¬Ã»Ïë ......

Interrupt in Linux£¨Ó²¼þƪ£©—— PIC


±¾ÎÄÀ´×Ô£ºhttp://blog.chinaunix.net/u2/66786/showart.php?id=601766
1.1Ê·Ç°µÄPIC
8259AÊǼ´ÎÒÃÇͨ³£ËµµÄPIC£¬Èçͼ1-1Ëùʾ£º
 
ͼ1-1 8259A
ÆäÖÐ×îÖØÒªµÄ¹Ü½ÅÊÇIR0~IR7£¨Interrupt Request0~7£¬ÓÃÓÚÁ¬½ÓÉ豸£©¡¢INT£¨Á¬½ÓCPU,µ±ÓÐÖжÏÇëÇóʱ£¬À­¸ß¸Ã¹Ü½ÅÒÔ֪ͨCPUÖжϵĵ½À´£©¡¢INTA£¨Á¬½ÓCPU£¬CPUͨ¹ý¸Ã¹Ü½ ......

LinuxÉ豸Çý¶¯Ö®I2C¼Ü¹¹·ÖÎö

Ò»:Ç°ÑÔ
I2cÊÇphilipsÌá³öµÄÍâÉè×ÜÏß.I2CÖ»ÓÐÁ½ÌõÏß,Ò»Ìõ´®ÐÐÊý¾ÝÏß:SDA,Ò»ÌõÊÇʱÖÓÏßSCL.ÕýÒòΪÕâÑù,Ëü·½±ãÁ˹¤³ÌÈËÔ±
µÄ²¼Ïß.ÁíÍâ,I2CÊÇÒ»ÖÖ¶àÖ÷»ú¿ØÖÆ×ÜÏß.ËüºÍUSB×ÜÏß²»Í¬,USBÊÇ»ùÓÚmaster-slave»úÖÆ,ÈκÎÉ豸µÄͨÐűØÐëÓÉÖ÷»ú·¢Æð²Å¿ÉÒÔ.¶ø
I2C ÊÇ»ùÓÚmulti master»úÖÆ.һͬ×ÜÏßÉÏ¿ÉÔÊÐí¶à¸ömaster.¹ØÓÚI2CЭÒéµÄÖª ......

WindowsÏÂжÔØLinuxϵͳ

   ÎҵĵçÄÔ°²×°ÁË˫ϵͳ£¬WindowsºÍLinux£¬²»¹ýÓÉÓÚLinuxÔÚ×î½üÒ»¶Îʱ¼äÄÚ²»»áʹÓã¬ËùÒÔÎÒ´òËãɾ³ýLinux¡£
   ɾ³ýLinux×îÐèҪעÒâµÄµØ·½£¬¾ÍÊÇMBR£¨Master Boot Record£©¡£ÔÚɾ³ýLinux·ÖÇøÇ°£¬ÎÒÃÇÐèÒª½«Æô¶¯WindowsµÄÒýµ¼ÐÅϢдÈëMBR£¬·ñÔò£¬MBRÖеÄLinuxÒýµ¼ÐÅÏ¢£¬µ±È»¾Í²»ÄÜÆô¶¯WindowsÏµÍ ......

linux ÖÐÎÄÏÔʾÂÒÂë½â¾ö°ì·¨


linux ÖÐÎÄÏÔʾÂÒÂë½â¾ö°ì·¨
vi /etc/sysconfig/i18n
½«ÄÚÈݸÄΪ
LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16"
ÕâÑùÖÐÎÄÔÚSSH,telnetÖն˾ͿÉÒÔÕý³£ÏÔʾ
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ