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

linux 2.6 kernel epoll

http://hi.baidu.com/j_fo/blog/item/a43fa60fa6e2f4eaab6457d5.html
Linux2.6ÄÚºËepoll½éÉÜ
2008-11-05 16:35
http://blog.csdn.net/rstevens/archive/2007/10/30/1858067.aspx
http://hi.baidu.com/jmlover/blog/item/24c28b131e6b48d7f7039ee6.html
http://hi.baidu.com/jmlover/blog/item/e64df724f12926348744f91b.html
Ãû´Ê½âÊÍ£ºman epollÖ®ºó£¬µÃµ½ÈçϽá¹û£º
NAME
epoll - I/O event notification facility
SYNOPSIS
#include <sys/epoll.h>
DEscrīptION
epoll is a variant of poll(2) that can be used either as Edge or Level
Triggered interface and scales well to large numbers of watched fds.
Three system calls are provided to set up and control an epoll set:
epoll_create(2), epoll_ctl(2), epoll_wait(2).
An epoll set is connected to a file descrīptor created by
epoll_create(2).   Interest for certain file descrīptors is then
registered via
epoll_ctl(2). Finally, the actual wait is started by epoll_wait(2).
Æäʵ£¬Ò»ÇеĽâÊͶ¼ÊǶàÓàµÄ£¬°´ÕÕÎÒÄ¿Ç°µÄÁ˽⣬EPOLLÄ£ÐÍËƺõÖ»ÓÐÒ»ÖÖ¸ñʽ£¬ËùÒÔ´ó¼ÒÖ»Òª²Î¿¼ÎÒÏÂÃæµÄ´úÂ룬¾ÍÄܹ»¶ÔEPOLLÓÐËùÁ˽âÁË£¬´úÂëµÄ½âÊͶ¼ÒѾ­ÔÚ×¢ÊÍÖУº
while (TRUE)
{
int nfds = epoll_wait (m_epoll_fd, m_events, MAX_EVENTS, EPOLL_TIME_OUT);//µÈ´ýEPOLLʼþµÄ·¢Éú£¬Ï൱ÓÚ¼àÌý£¬ÖÁÓÚÏà¹ØµÄ¶Ë¿Ú£¬ÐèÒªÔÚ³õʼ»¯EPOLLµÄʱºò°ó¶¨¡£
if (nfds <= 0)
continue;
m_bOnTimeChecking = FALSE;
G_CurTime = time(NULL);
for (int i=0; i<nfds; i++)
{
try
{
if (m_events[i].data.fd == m_listen_http_fd)//Èç¹ûмà²âµ½Ò»¸öHTTPÓû§Á¬½Óµ½°ó¶¨µÄHTTP¶Ë¿Ú£¬½¨Á¢ÐµÄÁ¬½Ó¡£ÓÉÓÚÎÒÃÇвÉÓÃÁËSOCKETÁ¬½Ó£¬ËùÒÔ»ù±¾Ã»Óá£
{
OnAcceptHttpEpoll ();
}
else if (m_events[i].data.fd == m_listen_sock_fd)//Èç¹ûмà²âµ½Ò»¸öSOCKETÓû§Á¬½Óµ½Á˰󶨵ÄSOCKET¶Ë¿Ú£¬½¨Á¢ÐµÄÁ¬½Ó¡£
{
OnAcceptSockEpoll ();
}
else if (m_events[i].events & EPOLLIN)//Èç¹ûÊÇÒѾ­Á¬½ÓµÄÓû§£¬²¢ÇÒÊÕµ½Êý¾Ý£¬ÄÇô½øÐжÁÈë¡£
{
OnReadEpoll (i);
}
OnWriteEpoll (i);//²é¿´µ±Ç°µÄ»î¶¯Á¬½ÓÊÇ·ñÓÐÐèҪд³öµÄÊý¾Ý¡£
}
catch (int)
{
PRINTF ("CATCH²¶»ñ´íÎó\n");


Ïà¹ØÎĵµ£º

ÔÚlinuxÏÂʵÏÖweb qqµÄ×ÀÃ滯


´´½¨×ÀÃæͼ±ê
Ä¿Ç°½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËƵķ½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ­°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......

linuxÍøÇÅÉèÖÃMACµØַʱµÄÐÐΪ

brctl addbr br0
ifconfig br0
br0 MAC is 00:00:00:00:00:00
brctl addif br0 eth1  (eth1 is xx:xx:xx:xx:xx:33)
ifconfig br0
br0 MAC is xx:xx:xx:xx:xx:33  same as eth1, auto change
brctl addif br0 eth2  (eth2 is xx:xx:xx:xx:xx:30)
ifconfig br0
br0 MAC is xx:xx:xx:xx:xx:30  sa ......

LinuxÏ°²×°MyEclipse

ÔÚ°²×°ÍêjdkÒԺ󣬾ÍÀ´°²×°MyEclipseÁË¡£
 ÓÐһЩ°²×°ÁËjdkÒÔºóûÓÐÉúЧ£¬³öÏֵĻ¹ÊÇ1.4°æ±¾µÄ¡£
ËùÒÔ°²×°MyEclipse7.0»òÕßÊÇ6.5¡¢6.6µÄ¶¼»á³ö´í
[root@gupt aaaa]# ll
×ÜÓÃÁ¿ 380
dr-xr-xr-x  6 root root   4096
2009-01-17  configuration
-r--r--r--  1 root root   7 ......

linux ipÃüÁî

ip ÊǸöÃüÁ ip ÃüÁîµÄ¹¦Äܺܶ࣡»ù±¾ÉÏËüÕûºÏÁË ifconfig Óë route ÕâÁ½¸öÃüÁ²»¹ýip µÄ¹¦ÄܸüÇ¿´ó£¡ Èç¹ûÄúÓÐÐËȤµÄ»°£¬Çë×ÔÐÐ vi /sbin/ifup ¾ÍÖªµÀÕû¸ö ifup ¾ÍÊÇÀûÓà ip Õâ¸öÃüÁîÀ´ÊµÏֵġ£ÏÂÃæ½éÉÜÒ»ÏÂʹÓ÷½·¨
[root@linux ~]# ip [option] [¶¯×÷] [ÃüÁî]
²ÎÊý£º
option £ºÉ趨µÄ²ÎÊý£¬Ö÷ÒªÓУº
   ......

³¹µ×½â¾ölinuxÏ GB2312 ÏÔʾ´íÎóÎÊÌâ

´ò¿ª /etc/sysconfig/i18n
ÊäÈë
LANG="zh_CN.GB2312"
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"
ºÃÁË ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ