{"id":273659,"date":"2023-05-30T04:06:00","date_gmt":"2023-05-29T20:06:00","guid":{"rendered":"https:\/\/gulass.cn\/lsjqdbcjz.html"},"modified":"2023-05-30T04:06:00","modified_gmt":"2023-05-29T20:06:00","slug":"lsjqdbcjz","status":"publish","type":"post","link":"https:\/\/gulass.cn\/lsjqdbcjz.html","title":{"rendered":"Linux\u4e8b\u4ef6\u9a71\u52a8\u7f16\u7a0b\u4e5d\u62db"},"content":{"rendered":"

\u5728\u8ba1\u7b97\u673a\u9886\u57df\u4e2dlinux \u4e8b\u4ef6\u89e6\u53d1<\/strong>\uff0c\u4e8b\u4ef6\u89e6\u53d1\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u7f16\u7a0b\u6a21\u5f0f\u3002\u5b83\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u54cd\u5e94\u5916\u90e8\u4e8b\u4ef6\uff0c\u4ece\u800c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u5904\u7406\u6548\u7387\u3002\u5728 Linux<\/a> \u7cfb\u7edf<\/a>\u4e2d\uff0c\u4e8b\u4ef6\u89e6\u53d1\u4e5f\u5f97\u5230\u4e86\u5e7f\u6cdb\u5e94\u7528\u3002\u672c\u6587\u5c06\u4ece\u4ee5\u4e0b\u4e5d\u4e2a\u65b9\u9762\u8be6\u7ec6\u4ecb\u7ecd Linux \u4e8b\u4ef6\u89e6\u53d1\u7684\u76f8\u5173\u77e5\u8bc6\u3002<\/p>\n

1.\u4ec0\u4e48\u662f\u4e8b\u4ef6\u89e6\u53d1<\/b><\/p>\n

\u4e8b\u4ef6\u89e6\u53d1\u662f\u4e00\u79cd\u5f02\u6b65\u7f16\u7a0b\u6a21\u5f0f\uff0c\u5b83\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5728\u4e0d\u963b\u585e\u4e3b\u7ebf\u7a0b\u7684\u60c5\u51b5\u4e0b\u54cd\u5e94\u5916\u90e8\u4e8b\u4ef6\u3002\u5728 Linux \u7cfb\u7edf\u4e2d\uff0c\u5e38\u89c1\u7684\u4e8b\u4ef6\u5305\u62ec\u6587\u4ef6\u53ef\u8bfb\u3001\u5957\u63a5\u5b57\u53ef\u8bfb\u3001\u5b9a\u65f6\u5668\u8d85\u65f6\u7b49\u3002<\/p>\n

2.\u6587\u4ef6\u53ef\u8bfb\u4e8b\u4ef6<\/b><\/p>\n

\u5728 Linux \u4e2d\uff0c\u6587\u4ef6\u53ef\u8bfb\u4e8b\u4ef6\u901a\u5e38\u4f7f\u7528 select<\/a> \u6216 epoll \u7b49\u7cfb\u7edf\u8c03\u7528\u6765\u5b9e\u73b0\u3002\u5f53\u4e00\u4e2a\u6587\u4ef6\u53d8\u4e3a\u53ef\u8bfb\u65f6\uff0c\u5185\u6838\u4f1a\u901a\u77e5\u8fdb\u7a0b\uff0c\u5e76\u4f7f select \u6216 epoll \u7b49\u7cfb\u7edf\u8c03\u7528\u8fd4\u56de\u3002<\/p>\n

3.\u5957\u63a5\u5b57\u53ef\u8bfb\u4e8b\u4ef6<\/b><\/p>\n

\u5957\u63a5\u5b57\u53ef\u8bfb\u4e8b\u4ef6\u4e0e\u6587\u4ef6\u53ef\u8bfb\u4e8b\u4ef6\u7c7b\u4f3c\uff0c\u4e0d\u540c\u4e4b\u5904\u5728\u4e8e\u5b83\u662f\u9488\u5bf9\u7f51\u7edc\u7f16\u7a0b\u800c\u8a00\u7684\u3002\u5f53\u4e00\u4e2a\u5957\u63a5\u5b57\u53d8\u4e3a\u53ef\u8bfb\u65f6\u4e2d\u6587linux\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5185\u6838\u4f1a\u901a\u77e5\u8fdb\u7a0b\uff0c\u5e76\u4f7f select \u6216 epoll \u7b49\u7cfb\u7edf\u8c03\u7528\u8fd4\u56de\u3002<\/p>\n

onfocus\u4e8b\u4ef6\u600e\u4e48\u89e6\u53d1\u4e0d\u4e86_linux \u4e8b\u4ef6\u89e6\u53d1_onblur\u4e8b\u4ef6\u4e0d\u505c\u5730\u89e6\u53d1<\/p>\n

4.\u5b9a\u65f6\u5668\u8d85\u65f6\u4e8b\u4ef6<\/b><\/p>\n

\u5b9a\u65f6\u5668\u8d85\u65f6\u4e8b\u4ef6\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5728\u6307\u5b9a\u65f6\u95f4\u540e\u6267\u884c\u67d0\u4e2a\u64cd\u4f5c\u3002\u5728 Linux \u4e2d\uff0c\u5b9a\u65f6\u5668\u901a\u5e38\u4f7f\u7528 timerfd_create \u7cfb\u7edf\u8c03\u7528\u6765\u521b\u5efa\uff0c\u5e76\u4f7f\u7528 select \u6216 epoll \u7b49\u7cfb\u7edf\u8c03\u7528\u6765\u76d1\u542c\u3002<\/p>\n

5.\u4e8b\u4ef6\u9a71\u52a8\u7684\u670d\u52a1\u5668\u6a21\u578b<\/b><\/p>\n

\u4e8b\u4ef6\u9a71\u52a8\u7684\u670d\u52a1\u5668\u6a21\u578b\u662f\u4e00\u79cd\u9ad8\u6548\u7684\u7f51\u7edc\u7f16\u7a0b\u6a21\u5f0f\uff0c\u5b83\u53ef\u4ee5\u8ba9\u670d\u52a1\u5668\u540c\u65f6\u5904\u7406\u591a\u4e2a\u8fde\u63a5\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u6bcf\u4e2a\u8fde\u63a5\u90fd\u88ab\u770b\u4f5c\u4e00\u4e2a\u4e8b\u4ef6\uff0c\u670d\u52a1\u5668\u4f1a\u4f7f\u7528 select \u6216 epoll \u7b49\u7cfb\u7edf\u8c03\u7528\u6765\u76d1\u542c\u6240\u6709\u8fde\u63a5\u4e0a\u662f\u5426\u6709\u6570\u636e\u53ef\u8bfb\u3002<\/p>\n

6.\u4e8b\u4ef6\u5faa\u73af<\/b><\/p>\n

\u4e8b\u4ef6\u5faa\u73af\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u7f16\u7a0b\u6a21\u5f0f\uff0c\u5b83\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5728\u7b49\u5f85\u4e8b\u4ef6\u65f6\u4e0d\u963b\u585e\u4e3b\u7ebf\u7a0b\u3002\u5728 Linux \u4e2d\uff0c\u4e8b\u4ef6\u5faa\u73af\u901a\u5e38\u4f7f\u7528 select \u6216 epoll \u7b49\u7cfb\u7edf\u8c03\u7528\u6765\u5b9e\u73b0\u3002<\/p>\n

7.\u5f02\u6b65 IO<\/b><\/p>\n

\u5f02\u6b65 IO \u662f\u4e00\u79cd\u9ad8\u6548\u7684 IO \u64cd\u4f5c\u65b9\u5f0flinux \u4e8b\u4ef6\u89e6\u53d1<\/strong>\uff0c\u5b83\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5728\u7b49\u5f85 IO \u5b8c\u6210\u65f6\u4e0d\u963b\u585e\u4e3b\u7ebf\u7a0b\u3002\u5728 Linux \u4e2d\uff0c\u5f02\u6b65 IO \u901a\u5e38\u4f7f\u7528 aio_read \u548c aio_write \u7b49\u7cfb\u7edf\u8c03\u7528\u6765\u5b9e\u73b0\u3002<\/p>\n

8.\u4fe1\u53f7\u9a71\u52a8\u7684 IO<\/b><\/p>\n

onfocus\u4e8b\u4ef6\u600e\u4e48\u89e6\u53d1\u4e0d\u4e86_onblur\u4e8b\u4ef6\u4e0d\u505c\u5730\u89e6\u53d1_linux \u4e8b\u4ef6\u89e6\u53d1<\/p>\n

\u4fe1\u53f7\u9a71\u52a8\u7684 IO \u662f\u4e00\u79cd\u9ad8\u6548\u7684 IO \u64cd\u4f5c\u65b9\u5f0flinux\u4e0b\u8f7d\uff0c\u5b83\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5728\u7b49\u5f85 IO \u5b8c\u6210\u65f6\u4e0d\u963b\u585e\u4e3b\u7ebf\u7a0b\u3002\u5728 Linux \u4e2d\uff0c\u4fe1\u53f7\u9a71\u52a8\u7684 IO \u901a\u5e38\u4f7f\u7528 sigaction \u7cfb\u7edf\u8c03\u7528\u6765\u5b9e\u73b0\u3002<\/p>\n

9.\u603b\u7ed3<\/b><\/p>\n

Linux \u4e8b\u4ef6\u89e6\u53d1\u662f\u4e00\u79cd\u9ad8\u6548\u7684\u7f16\u7a0b\u6a21\u5f0f\uff0c\u5b83\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5728\u4e0d\u963b\u585e\u4e3b\u7ebf\u7a0b\u7684\u60c5\u51b5\u4e0b\u54cd\u5e94\u5916\u90e8\u4e8b\u4ef6\u3002\u5728\u5b9e\u9645\u7f16\u7a0b\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u4e0d\u540c\u7684\u4e8b\u4ef6\u89e6\u53d1\u65b9\u5f0f\uff0c\u4ee5\u8fbe\u5230\u66f4\u9ad8\u6548\u7684\u7a0b\u5e8f\u5904\u7406\u6548\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728\u8ba1\u7b97\u673a\u9886\u57df\u4e2d\uff0c\u4e8b\u4ef6\u89e6\u53d1\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u7f16\u7a0b\u6a21\u5f0f\u3002\u4e8b\u4ef6\u89e6\u53d1\u662f\u4e00\u79cd\u5f02\u6b65\u7f16\u7a0b\u6a21\u5f0f\uff0c\u5b83\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5728\u4e0d\u963b\u585e\u4e3b\u7ebf\u7a0b\u7684\u60c5\u51b5\u4e0b\u54cd\u5e94\u5916\u90e8\u4e8b\u4ef6\u3002\u4e8b\u4ef6\u9a71\u52a8\u7684\u670d\u52a1\u5668\u6a21\u578b\u662f\u4e00\u79cd\u9ad8\u6548\u7684\u7f51\u7edc\u7f16\u7a0b\u6a21\u5f0f\uff0c\u5b83\u53ef\u4ee5\u8ba9\u670d\u52a1\u5668\u540c\u65f6\u5904\u7406\u591a\u4e2a\u8fde\u63a5\u3002\u4e8b\u4ef6\u89e6\u53d1\u662f\u4e00\u79cd\u9ad8\u6548\u7684\u7f16\u7a0b\u6a21\u5f0f\uff0c\u5b83\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5728\u4e0d\u963b\u585e\u4e3b\u7ebf\u7a0b\u7684\u60c5\u51b5\u4e0b\u54cd\u5e94\u5916\u90e8\u4e8b\u4ef6\u3002\u5728\u5b9e\u9645\u7f16\u7a0b\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u4e0d\u540c\u7684\u4e8b\u4ef6\u89e6\u53d1\u65b9\u5f0f\uff0c\u4ee5\u8fbe\u5230\u66f4\u9ad8\u6548\u7684\u7a0b\u5e8f\u5904\u7406\u6548\u679c\u3002<\/p>\n","protected":false},"author":1,"featured_media":273660,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-273659","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/273659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=273659"}],"version-history":[{"count":0,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/273659\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/273660"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=273659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=273659"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=273659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}