{"id":54604,"date":"2025-08-13T08:29:57","date_gmt":"2025-08-13T00:29:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/54604.html"},"modified":"2025-08-13T08:29:57","modified_gmt":"2025-08-13T00:29:57","slug":"%e3%80%90linux-epoll%e7%9b%b8%e8%be%83%e4%ba%8eselect%e5%92%8cpoll%e7%9a%84%e7%89%b9%e7%82%b9%e3%80%91","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/54604.html","title":{"rendered":"\u3010Linux epoll\u76f8\u8f83\u4e8eselect\u548cpoll\u7684\u7279\u70b9\u3011"},"content":{"rendered":"<p>epoll \u76f8\u8f83\u4e8e select \u548c poll \u7684\u6838\u5fc3\u4f18\u52bf\u5728\u4e8e\u5176\u4e8b\u4ef6\u9a71\u52a8\u7684\u9ad8\u6548\u8bbe\u8ba1&#xff0c;\u7279\u522b\u9002\u5408\u9ad8\u5e76\u53d1\u573a\u666f\u3002\u4ee5\u4e0b\u662f\u4e3b\u8981\u7279\u70b9\u53ca\u5bf9\u6bd4\u5206\u6790&#xff1a;<\/p>\n<hr \/>\n<h4>\u2699\ufe0f \u4e00\u3001\u5de5\u4f5c\u673a\u5236\u4e0e\u6548\u7387\u5bf9\u6bd4<\/h4>\n<li>\n<p>\u4e8b\u4ef6\u9a71\u52a8 vs \u8f6e\u8be2<\/p>\n<ul>\n<li>select\/poll&#xff1a;\u91c7\u7528\u8f6e\u8be2\u673a\u5236&#xff08;O(n)\u590d\u6742\u5ea6&#xff09;&#xff0c;\u6bcf\u6b21\u8c03\u7528\u9700\u904d\u5386\u6240\u6709\u76d1\u542c\u7684\u63cf\u8ff0\u7b26&#xff0c;\u65e0\u8bba\u662f\u5426\u6d3b\u8dc3\u3002\u5f53\u8fde\u63a5\u6570&#xff08;FD&#xff09;\u589e\u52a0\u65f6&#xff0c;\u6027\u80fd\u7ebf\u6027\u4e0b\u964d\u3002<\/li>\n<li>epoll&#xff1a;\u57fa\u4e8e\u56de\u8c03\u673a\u5236&#xff08;O(1)\u590d\u6742\u5ea6&#xff09;&#xff0c;\u5185\u6838\u901a\u8fc7\u4e8b\u4ef6\u901a\u77e5\u4ec5\u8fd4\u56de\u5c31\u7eea\u7684FD&#xff0c;\u65e0\u9700\u904d\u5386\u5168\u90e8\u8fde\u63a5\u3002\u6027\u80fd\u4e0e\u6d3b\u8dc3\u8fde\u63a5\u6570\u76f8\u5173&#xff0c;\u4e0e\u603b\u8fde\u63a5\u6570\u65e0\u5173\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6587\u4ef6\u63cf\u8ff0\u7b26\u6570\u91cf\u9650\u5236<\/p>\n<ul>\n<li>select&#xff1a;\u53d7 FD_SETSIZE \u9650\u5236&#xff08;\u9ed8\u8ba41024&#xff09;&#xff0c;\u9700\u91cd\u65b0\u7f16\u8bd1\u5185\u6838\u8c03\u6574&#xff0c;\u4f46\u65e0\u6cd5\u89e3\u51b3\u6027\u80fd\u95ee\u9898\u3002<\/li>\n<li>poll&#xff1a;\u65e0\u786c\u6027\u4e0a\u9650&#xff08;\u57fa\u4e8e\u94fe\u8868\u5b58\u50a8&#xff09;&#xff0c;\u4f46\u5927\u91cfFD\u65f6\u904d\u5386\u6548\u7387\u4f4e\u3002<\/li>\n<li>epoll&#xff1a;\u65e0\u4e0a\u9650&#xff0c;\u5355\u673a\u53ef\u652f\u6301\u6570\u5341\u4e07\u8fde\u63a5&#xff08;\u59821GB\u5185\u5b58\u7ea610\u4e07FD&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<hr \/>\n<h4>&#x1f4be; \u4e8c\u3001\u5185\u5b58\u4e0e\u6570\u636e\u7ba1\u7406\u673a\u5236<\/h4>\n<li>\n<p>\u6570\u636e\u62f7\u8d1d\u5f00\u9500<\/p>\n<ul>\n<li>select\/poll&#xff1a;\u6bcf\u6b21\u8c03\u7528\u9700\u5c06\u6574\u4e2aFD\u96c6\u5408\u4ece\u7528\u6237\u7a7a\u95f4\u590d\u5236\u5230\u5185\u6838\u7a7a\u95f4&#xff0c;\u9ad8\u9891\u8c03\u7528\u65f6\u5f00\u9500\u5de8\u5927\u3002<\/li>\n<li>epoll&#xff1a;\n<ul>\n<li>\u901a\u8fc7 epoll_ctl \u6ce8\u518cFD\u5230\u5185\u6838\u7ea2\u9ed1\u6811&#xff08;\u4ec5\u4e00\u6b21\u62f7\u8d1d&#xff09;\u3002<\/li>\n<li>\u4f7f\u7528 mmap \u5185\u5b58\u6620\u5c04&#xff0c;\u51cf\u5c11\u5185\u6838\u4e0e\u7528\u6237\u7a7a\u95f4\u7684\u6570\u636e\u590d\u5236\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u52a8\u6001\u7ba1\u7406\u7075\u6d3b\u6027<\/p>\n<ul>\n<li>epoll \u652f\u6301\u52a8\u6001\u589e\u5220FD&#xff08;EPOLL_CTL_ADD\/MOD\/DEL&#xff09;&#xff0c;\u800c select\/poll \u9700\u6bcf\u6b21\u91cd\u65b0\u4f20\u5165\u5b8c\u6574FD\u96c6\u5408\u3002<\/li>\n<\/ul>\n<\/li>\n<hr \/>\n<h4>&#x1f50c; \u4e09\u3001\u89e6\u53d1\u6a21\u5f0f&#xff1a;\u6c34\u5e73\u89e6\u53d1&#xff08;LT&#xff09; vs \u8fb9\u7f18\u89e6\u53d1&#xff08;ET&#xff09;<\/h4>\n<p>epoll \u72ec\u6709\u53cc\u89e6\u53d1\u6a21\u5f0f&#xff0c;\u9002\u5e94\u4e0d\u540c\u573a\u666f\u9700\u6c42&#xff1a;<\/p>\n<ul>\n<li>\u6c34\u5e73\u89e6\u53d1&#xff08;LT&#xff09;&#xff1a;\n<ul>\n<li>\u53ea\u8981FD\u7f13\u51b2\u533a\u6709\u6570\u636e&#xff0c;\u6301\u7eed\u901a\u77e5\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<li>\u7c7b\u4f3c select\/poll \u7684\u884c\u4e3a&#xff0c;\u7f16\u7a0b\u7b80\u5355\u4f46\u53ef\u80fd\u91cd\u590d\u89e6\u53d1\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u8fb9\u7f18\u89e6\u53d1&#xff08;ET&#xff09;&#xff1a;\n<ul>\n<li>\u4ec5\u5728FD\u72b6\u6001\u53d8\u5316\u65f6\u901a\u77e5\u4e00\u6b21&#xff08;\u5982\u65b0\u6570\u636e\u5230\u8fbe&#xff09;&#xff0c;\u9700\u4e00\u6b21\u6027\u5904\u7406\u5b8c\u6240\u6709\u6570\u636e&#xff08;\u907f\u514d\u9057\u6f0f&#xff09;\u3002<\/li>\n<li>\u51cf\u5c11\u65e0\u6548\u901a\u77e5&#xff0c;\u63d0\u5347\u6027\u80fd&#xff08;\u5982Nginx\u9ed8\u8ba4\u4f7f\u7528ET&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u2705 ET\u6a21\u5f0f\u6ce8\u610f\u4e8b\u9879&#xff1a;\u9700\u5faa\u73af\u8bfb\u5199\u76f4\u5230\u8fd4\u56de EAGAIN \u9519\u8bef&#xff0c;\u5426\u5219\u53ef\u80fd\u4e22\u5931\u6570\u636e\u3002<\/p>\n<hr \/>\n<h4>&#x1f310; \u56db\u3001\u9002\u7528\u573a\u666f\u5206\u6790<\/h4>\n<table>\n<tr>\u673a\u5236\u9002\u7528\u573a\u666f\u6027\u80fd\u74f6\u9888<\/tr>\n<tbody>\n<tr>\n<td>select<\/td>\n<td>\u8de8\u5e73\u53f0\u517c\u5bb9\u3001\u4f4e\u5e76\u53d1&#xff08;&lt;1k\u8fde\u63a5&#xff09;<\/td>\n<td>FD\u6570\u91cf\u8d85\u8fc71024\u65f6\u6027\u80fd\u9aa4\u964d<\/td>\n<\/tr>\n<tr>\n<td>poll<\/td>\n<td>\u4e2d\u7b49\u5e76\u53d1\u3001FD\u52a8\u6001\u53d8\u5316<\/td>\n<td>\u5927\u91cfFD\u65f6\u904d\u5386\u6548\u7387\u4f4e<\/td>\n<\/tr>\n<tr>\n<td>epoll<\/td>\n<td>\u9ad8\u5e76\u53d1&#xff08;&gt;10k\u8fde\u63a5&#xff09;\u3001\u957f\u8fde\u63a5\u670d\u52a1&#xff08;\u5982Web\u670d\u52a1\u5668\u3001\u5b9e\u65f6\u63a8\u9001&#xff09;<\/td>\n<td>\u6240\u6709FD\u5747\u6d3b\u8dc3\u65f6\u56de\u8c03\u7ade\u4e89\u53ef\u80fd\u5f71\u54cd\u6027\u80fd<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul>\n<li>\u5178\u578b\u6848\u4f8b&#xff1a;\n<ul>\n<li>\u7535\u5546\u5927\u4fc3\u671f\u95f4&#xff0c;epoll \u5c06\u5e73\u5747\u54cd\u5e94\u65f6\u95f4\u4ece5\u79d2\u964d\u81f31\u79d2\u5185&#xff0c;\u6709\u6548\u5e94\u5bf9\u6d41\u91cf\u5cf0\u503c\u3002<\/li>\n<li>\u817e\u8baf\/\u963f\u91cc\u7b49\u4f01\u4e1a\u4f7f\u7528 epoll \u652f\u6491\u767e\u4e07\u7ea7\u957f\u8fde\u63a5&#xff08;\u5982\u5fae\u4fe1\u540e\u53f0\u670d\u52a1&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<h4>&#x1f48e; \u603b\u7ed3&#xff1a;\u4e09\u8005\u7684\u6838\u5fc3\u5dee\u5f02\u5bf9\u6bd4<\/h4>\n<table>\n<tr>\u7279\u6027selectpollepoll<\/tr>\n<tbody>\n<tr>\n<td>\u6700\u5927\u8fde\u63a5\u6570<\/td>\n<td>1024&#xff08;\u786c\u9650\u5236&#xff09;<\/td>\n<td>\u65e0\u4e0a\u9650<\/td>\n<td>\u65e0\u4e0a\u9650<\/td>\n<\/tr>\n<tr>\n<td>\u65f6\u95f4\u590d\u6742\u5ea6<\/td>\n<td>O(n)<\/td>\n<td>O(n)<\/td>\n<td>O(1)&#xff08;\u6d3b\u8dc3\u8fde\u63a5&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u6570\u636e\u62f7\u8d1d<\/td>\n<td>\u6bcf\u6b21\u8c03\u7528\u5168\u91cf\u590d\u5236<\/td>\n<td>\u6bcf\u6b21\u8c03\u7528\u5168\u91cf\u590d\u5236<\/td>\n<td>\u521d\u59cb\u6ce8\u518c&#043;\u5171\u4eab\u5185\u5b58<\/td>\n<\/tr>\n<tr>\n<td>\u89e6\u53d1\u6a21\u5f0f<\/td>\n<td>\u4ec5\u6c34\u5e73\u89e6\u53d1<\/td>\n<td>\u4ec5\u6c34\u5e73\u89e6\u53d1<\/td>\n<td>\u652f\u6301LT\/ET<\/td>\n<\/tr>\n<tr>\n<td>\u7f16\u7a0b\u590d\u6742\u5ea6<\/td>\n<td>\u4f4e<\/td>\n<td>\u4e2d<\/td>\n<td>\u9ad8&#xff08;\u5c24\u5176ET\u6a21\u5f0f&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u8de8\u5e73\u53f0\u652f\u6301<\/td>\n<td>\u5e7f\u6cdb<\/td>\n<td>\u7c7bUnix\u7cfb\u7edf<\/td>\n<td>\u4ec5Linux<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#x1f4a1; \u7ed3\u8bba&#xff1a;epoll \u901a\u8fc7\u4e8b\u4ef6\u9a71\u52a8\u3001\u96f6\u62f7\u8d1d\u3001\u53cc\u89e6\u53d1\u6a21\u5f0f\u89e3\u51b3\u4e86 select\/poll \u7684\u6027\u80fd\u74f6\u9888&#xff0c;\u6210\u4e3a Linux \u9ad8\u5e76\u53d1\u7f51\u7edc\u7f16\u7a0b\u7684\u4e8b\u5b9e\u6807\u51c6\u3002\u4f46\u5176\u590d\u6742\u6027\u548c\u5e73\u53f0\u5c40\u9650\u6027\u9700\u7ed3\u5408\u573a\u666f\u6743\u8861\u2014\u2014\u82e5\u9700\u8de8\u5e73\u53f0\u6216\u4f4e\u5e76\u53d1&#xff0c;select\/poll \u4ecd\u662f\u53ef\u884c\u9009\u9879&#xff1b;\u8ffd\u6c42\u6781\u81f4\u6027\u80fd\u5219\u5fc5\u9009 epoll\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb174\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u6458\u8981\uff1a epoll \u76f8\u6bd4 select\/poll \u5728\u9ad8\u5e76\u53d1\u573a\u666f\u5177\u6709\u663e\u8457\u4f18\u52bf\uff0c\u5176\u4e8b\u4ef6\u9a71\u52a8\u673a\u5236\uff08O(1)\u590d\u6742\u5ea6\uff09\u4ec5\u901a\u77e5\u6d3b\u8dc3\u8fde\u63a5\uff0c\u800c select\/poll \u9700\u8f6e\u8be2\u6240\u6709\u8fde\u63a5\uff08O(n)\uff09\u3002epoll \u652f\u6301\u65e0\u4e0a\u9650\u8fde\u63a5\u6570\uff0c\u901a\u8fc7\u7ea2\u9ed1\u6811\u548c\u5185\u5b58\u6620\u5c04\u51cf\u5c11\u6570\u636e\u62f7\u8d1d\uff0c\u5e76\u72ec\u6709**\u8fb9\u7f18\u89e6\u53d1\uff08ET\uff09**\u6a21\u5f0f\u63d0\u5347\u6548\u7387\u3002\u5b9e\u6d4b\u663e\u793a\uff0cepoll \u572810\u4e07\u7ea7\u8fde\u63a5\u4e0b\u4ecd\u4fdd\u6301\u9ad8\u6027\u80fd\uff0c\u800c select \u53d7\u9650\u4e8e1024\u8fde\u63a5\u4e14\u6027\u80fd\u9aa4\u964d\u3002\u4f46 epoll \u4ec5\u652f\u6301 Linux\uff0c\u590d\u6742\u5ea6\u8f83\u9ad8\u3002\u9009\u62e9\u5efa\u8bae\uff1a\u9ad8\u5e76\u53d1\u7528 epoll\uff0c\u8de8\u5e73\u53f0\u6216\u4f4e\u5e76\u53d1\u53ef\u9009 select\/poll\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,100,44],"topic":[],"class_list":["post-54604","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-100","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Linux epoll\u76f8\u8f83\u4e8eselect\u548cpoll\u7684\u7279\u70b9\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/54604.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Linux epoll\u76f8\u8f83\u4e8eselect\u548cpoll\u7684\u7279\u70b9\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb174\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u6458\u8981\uff1a epoll \u76f8\u6bd4 select\/poll \u5728\u9ad8\u5e76\u53d1\u573a\u666f\u5177\u6709\u663e\u8457\u4f18\u52bf\uff0c\u5176\u4e8b\u4ef6\u9a71\u52a8\u673a\u5236\uff08O(1)\u590d\u6742\u5ea6\uff09\u4ec5\u901a\u77e5\u6d3b\u8dc3\u8fde\u63a5\uff0c\u800c select\/poll \u9700\u8f6e\u8be2\u6240\u6709\u8fde\u63a5\uff08O(n)\uff09\u3002epoll \u652f\u6301\u65e0\u4e0a\u9650\u8fde\u63a5\u6570\uff0c\u901a\u8fc7\u7ea2\u9ed1\u6811\u548c\u5185\u5b58\u6620\u5c04\u51cf\u5c11\u6570\u636e\u62f7\u8d1d\uff0c\u5e76\u72ec\u6709**\u8fb9\u7f18\u89e6\u53d1\uff08ET\uff09**\u6a21\u5f0f\u63d0\u5347\u6548\u7387\u3002\u5b9e\u6d4b\u663e\u793a\uff0cepoll \u572810\u4e07\u7ea7\u8fde\u63a5\u4e0b\u4ecd\u4fdd\u6301\u9ad8\u6027\u80fd\uff0c\u800c select \u53d7\u9650\u4e8e1024\u8fde\u63a5\u4e14\u6027\u80fd\u9aa4\u964d\u3002\u4f46 epoll \u4ec5\u652f\u6301 Linux\uff0c\u590d\u6742\u5ea6\u8f83\u9ad8\u3002\u9009\u62e9\u5efa\u8bae\uff1a\u9ad8\u5e76\u53d1\u7528 epoll\uff0c\u8de8\u5e73\u53f0\u6216\u4f4e\u5e76\u53d1\u53ef\u9009 select\/poll\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/54604.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-13T00:29:57+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/54604.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/54604.html\",\"name\":\"\u3010Linux epoll\u76f8\u8f83\u4e8eselect\u548cpoll\u7684\u7279\u70b9\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-13T00:29:57+00:00\",\"dateModified\":\"2025-08-13T00:29:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/54604.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/54604.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/54604.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Linux epoll\u76f8\u8f83\u4e8eselect\u548cpoll\u7684\u7279\u70b9\u3011\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Linux epoll\u76f8\u8f83\u4e8eselect\u548cpoll\u7684\u7279\u70b9\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/54604.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Linux epoll\u76f8\u8f83\u4e8eselect\u548cpoll\u7684\u7279\u70b9\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb174\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u6458\u8981\uff1a epoll \u76f8\u6bd4 select\/poll \u5728\u9ad8\u5e76\u53d1\u573a\u666f\u5177\u6709\u663e\u8457\u4f18\u52bf\uff0c\u5176\u4e8b\u4ef6\u9a71\u52a8\u673a\u5236\uff08O(1)\u590d\u6742\u5ea6\uff09\u4ec5\u901a\u77e5\u6d3b\u8dc3\u8fde\u63a5\uff0c\u800c select\/poll \u9700\u8f6e\u8be2\u6240\u6709\u8fde\u63a5\uff08O(n)\uff09\u3002epoll \u652f\u6301\u65e0\u4e0a\u9650\u8fde\u63a5\u6570\uff0c\u901a\u8fc7\u7ea2\u9ed1\u6811\u548c\u5185\u5b58\u6620\u5c04\u51cf\u5c11\u6570\u636e\u62f7\u8d1d\uff0c\u5e76\u72ec\u6709**\u8fb9\u7f18\u89e6\u53d1\uff08ET\uff09**\u6a21\u5f0f\u63d0\u5347\u6548\u7387\u3002\u5b9e\u6d4b\u663e\u793a\uff0cepoll \u572810\u4e07\u7ea7\u8fde\u63a5\u4e0b\u4ecd\u4fdd\u6301\u9ad8\u6027\u80fd\uff0c\u800c select \u53d7\u9650\u4e8e1024\u8fde\u63a5\u4e14\u6027\u80fd\u9aa4\u964d\u3002\u4f46 epoll \u4ec5\u652f\u6301 Linux\uff0c\u590d\u6742\u5ea6\u8f83\u9ad8\u3002\u9009\u62e9\u5efa\u8bae\uff1a\u9ad8\u5e76\u53d1\u7528 epoll\uff0c\u8de8\u5e73\u53f0\u6216\u4f4e\u5e76\u53d1\u53ef\u9009 select\/poll\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/54604.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-13T00:29:57+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/54604.html","url":"https:\/\/www.wsisp.com\/helps\/54604.html","name":"\u3010Linux epoll\u76f8\u8f83\u4e8eselect\u548cpoll\u7684\u7279\u70b9\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-13T00:29:57+00:00","dateModified":"2025-08-13T00:29:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/54604.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/54604.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/54604.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Linux epoll\u76f8\u8f83\u4e8eselect\u548cpoll\u7684\u7279\u70b9\u3011"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/54604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=54604"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/54604\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=54604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=54604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=54604"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=54604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}