{"id":326261,"date":"2021-02-07T00:23:33","date_gmt":"2021-02-06T16:23:33","guid":{"rendered":"http:\/\/4563.org\/?p=326261"},"modified":"2021-02-07T00:23:33","modified_gmt":"2021-02-06T16:23:33","slug":"%e5%87%a0%e4%b8%aa%e5%85%b3%e4%ba%8e-go-runtime-%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=326261","title":{"rendered":"\u51e0\u4e2a\u5173\u4e8e Go Runtime \u7684\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u51e0\u4e2a\u5173\u4e8e Go Runtime \u7684\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Dongxiem <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u95ee\u9898\uff1ago \u7684 runtime \u5982\u4f55\u5b9e\u73b0\uff1f\uff08\u8fd9\u4e2a\u5b9e\u5728\u4e0d\u7406\u89e3\uff09<\/p>\n<p>\u8ffd\u95ee\uff1aruntime \u8fd9\u4e2a\u8fdb\u7a0b\u662f\u8fd0\u884c\u5728\u54ea\u513f\u7684\uff1f<\/p>\n<p>\u8ffd\u95ee\uff1a\u6bcf\u4e2a go \u8fdb\u7a0b\u90fd\u4f1a\u6709\u4e00\u4e2a\u5417\u8fd8\u662f\u5171\u7528\u4e00\u4e2a\uff1f\uff08\u5e94\u8be5\u662f\u5171\u7528\u4e00\u4e2a\uff09<\/p>\n<p>\u8ffd\u95ee\uff1a\u5982\u679c\u4f60\u8fd0\u884c\u4e86 go \u8fdb\u7a0b\uff0c\u5728 linux \u7cfb\u7edf\u91cc\u67e5\u770b\u8fdb\u7a0b\u80fd\u770b\u5230 runtime \u8fdb\u7a0b\u5417\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>57<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5225298\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : saberlong <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             golang \u7684 runtime \u6e90\u7801\u5728 src \u53ef\u4ee5\u76f4\u63a5\u627e\u5230\u3002\u771f\u6b63\u7684 main \u51fd\u6570\u5176\u5b9e\u662f\u5728 runtime \u91cc\u3002\u7136\u540e\u4f60\u53ef\u4ee5\u770b\u5230\u542f\u52a8\u7684\u6b65\u9aa4\uff0c\u5305\u62ec\u4e0d\u9650\u4e8e\u542f\u52a8 g0 \u534f\u7a0b\u548c\u542f\u52a8 gc \u5de5\u4f5c\u3002<br \/>\u6bcf\u4e2a go \u8fdb\u7a0b\u662f\u81ea\u5df1\u72ec\u7acb\u7684\uff0c\u548c\u865a\u62df\u673a\u533a\u5206\u5f00\u6765\u3002\u6ca1\u6709\u72ec\u7acb\u7684 runtime \u8fdb\u7a0b\u3002<br \/>\u7b80\u5355\u7684\u8bb2\uff0c\u4f60\u53ef\u4ee5\u7406\u89e3\u6210 c \u8bed\u8a00\u52a0\u5165\u4e86\u534f\u7a0b\u548c gc \u7684\u6846\u67b6\u3002\u7531\u4e8e\u6709 gc\uff0c\u6240\u4ee5\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528\u7cfb\u7edf\u5206\u914d\u5185\u5b58\u7684\u51fd\u6570\uff0c\u90fd\u662f\u901a\u8fc7\u8fd9\u4e2a\u6846\u67b6\u63d0\u4f9b\u7684\u51fd\u6570\u6765\u5206\u914d\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225299\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Jirajine <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             runtime \u5c31\u662f\u4f60\u7f16\u8bd1\u51fa\u7684\u7a0b\u5e8f\u4e2d\u4f60\u81ea\u5df1\u7684\u4ee3\u7801\u4ee5\u5916\u7684\u90e8\u5206\u3002<br \/>\u6bd4\u5982\u4e00\u4e2a c \u7a0b\u5e8f\uff0c\u4e0d\u4f1a\u76f4\u63a5\u6267\u884c main\uff0c\u800c\u662f\u6267\u884c_start \uff08\u591a\u6570\u5e73\u53f0\uff09\uff0c\u8fd9\u4e2a\u51fd\u6570\u4f1a\u5148\u8fdb\u884c\u4e00\u4e9b\u6808\u7a7a\u95f4\u7b49\u521d\u59cb\u5316\uff0c\u7136\u540e\u518d\u8c03\u7528\u4f60\u7684 main \u51fd\u6570\u3002\u8fd9\u4e2a\u51fd\u6570\u5c31\u662f\u7531 c \u7684 runtime \u63d0\u4f9b\u3002<br \/>go \u8fd9\u6837\u7684\u8bed\u8a00 runtime \u505a\u7684\u4e8b\u60c5\u66f4\u591a\uff0c\u521d\u59cb\u5316\u7ebf\u7a0b\u6c60\u3001\u8c03\u5ea6\u5668\u3001gc \u3001unwind \u7b49\uff0c\u7136\u540e\u518d\u628a\u4f60\u7684 main \u51fd\u6570\u4f5c\u4e3a\u4e00\u4e2a goroutine \u542f\u52a8\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225300\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : saberlong <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5165\u53e3\u4ee3\u7801\u5728 src\/runtime\/proc.go \u3002\u6709\u4e2a func main()                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225301\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : PureWhiteWu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u522b\u7684\u4e0d\u8bf4\uff0c\u5982\u679c\u8fd9\u662f\u9762\u8bd5\uff0c\u5982\u679c\u4f60\u90fd\u56de\u590d\u4e0d\u77e5\u9053 go runtime \u600e\u4e48\u5b9e\u73b0\u4e86\uff0c\u8fd8\u8ffd\u7740\u95ee\u4e0b\u9762\u7684\u4e09\u4e2a\u95ee\u9898\uff0c\u90a3\u8fd9\u9762\u8bd5\u5b98\u59a5\u59a5 sb \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225302\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 1011 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             runtime \u53ea\u662f\u4e00\u4e2a\u540d\u5b57\u800c\u5df2\uff0c\u672c\u8d28\u53ea\u662f\u4e00\u4e2a\u201c\u5e93\u201d\uff0cgo \u7a0b\u5e8f\u7f16\u8bd1\u65f6\u5b83\u5c06\u548c\u6211\u4eec\u7f16\u5199\u7684\u4ee3\u7801\u4e00\u540c\u7f16\u8bd1\u4e3a\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6<br \/>golang.org\/doc\/faq#runtime                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225303\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             C \u4e5f\u6709 runtime \u5462\uff0c\u5e94\u8be5\u53bb\u60f3\u60f3 crt \u600e\u4e48\u505a\u7684\uff08\u522b\u8bf4\u4eba\u5bb6\u53eb libc \u5c31\u4e0d\u7b97 crt \u4e86\uff09<br \/>C++\u4e5f\u6709 runtime\uff0c\u53eb libstdc++\/libc++\/vcruntime<\/p>\n<p>C \u7684\u53ef\u4ee5\u5171\u4eab\uff0c\u4e5f\u53ef\u4ee5\u9759\u6001\u94fe\u63a5\u8fdb\u53bb\uff08<br \/>go \u7684\u5c31\u4e0d\u884c\u4e86\uff0c\u6bcf\u4e2a\u90fd\u81ea\u5df1\u5e26\u4e00\u4efd                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225304\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : henglinli <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             golang \u7684 runtime \u5176\u5b9e\u662f\u4e2a\u7ebf\u7a0b\u6c60\uff0c\u7528 work-steal \u8c03\u5ea6\u7b97\u6cd5\u8c03\u5ea6 goroutine \u3002golang \u7684\u5b9e\u73b0\u5df2\u77e5\u7684\u6709 go gccgo llgo\uff0cgccgo \u4e5f\u662f go \u7684\u5b98\u65b9\u5b9e\u73b0\u5c31\u662f\u4e0b\u9762\u7684 gofrontend\uff0cllgo \u5df2\u7ecf\u5b8c\u4e86\u3002\u53c2\u89c1 https:\/\/docs.google.com\/document\/d\/1TTj4T2JO42uD5ID9e89oa0sLKhJYD0Y_kqxDv3I3XMw\/edit#heading=h.nfb3viti0vlt<\/p>\n<p>runtime \u8fd0\u884c\u5728 OS \u7ebf\u7a0b\u4e0a,\u6bd4\u5982 pthread \u3002\u53c2\u89c1 https:\/\/github.com\/golang\/gofrontend\/blob\/master\/libgo\/runtime\/go-libmain.c#L208<\/p>\n<p>go \u8fdb\u7a0b\u5e94\u8be5\u662f goroutine \u5427\u3002\u8fd9\u4e2a\u771f\u4e0d\u597d\u56de\u7b54\u3002\u6709\u5f88\u591a\u4e2a\uff0c\u4f46\u81f3\u5c11\u6709\u4e00\u4e2a runtime.main\uff0c\u81f3\u4e8e\u6700\u591a\u6709\u591a\u5c11\u4e2a\uff0c\u5982\u679c golang \u5b9e\u73b0\u8005\u8003\u8651\u8fc7\u8fd9\u4e2a\u95ee\u9898\u7684\u8bdd\uff0c\u4f1a\u6709\u4e00\u4e2a\u53ef\u4ee5\u8bbe\u7f6e\u7684\u53c2\u6570\u7684\uff0c\u53ef\u4ee5\u7528\u73af\u5883\u53d8\u91cf GOMAXPROCS \u9650\u5236 OS \u7ebf\u7a0b\u6570\u3002<br \/>\u6bd4\u5982\uff1a\u4e00\u4e2a\u53ea\u6709 http.ListenAndServe \u7684 pprof go \u7a0b\u5e8f\uff0c\u6709 3 \u4e2a goroutine\uff0c5 \u4e2a OS \u7ebf\u7a0b\u3002\/\/go version go1.15.7 darwin\/amd64<\/p>\n<p>linux \u91cc\u7cfb\u7edf\u67e5\u770b go \u8fdb\u7a0b\u662f\u6307 top \u7528\u67e5\u770b go \u7a0b\u5e8f\u5427\u3002top \u67e5\u770b\u5230\u7684\u662f\u90a3\u4e2a\u201c\u7ebf\u7a0b\u6c60\u201d\uff0c\u7528 pprof \u53ef\u4ee5\u67e5\u770b goroutine \u3002<br \/>\u53c2\u89c1 https:\/\/golang.google.cn\/pkg\/net\/http\/pprof\/                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225305\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : baiyi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             runtime \u4e0d\u662f\u5b8c\u5168\u72ec\u7acb\u4e8e\u4f60\u7a0b\u5e8f\u7684\u4e00\u4e2a\u8fdb\u7a0b\u3002\u76f8\u53cd\uff0c\u4f60\u5199\u7684\u7a0b\u5e8f\u662f\u4f5c\u4e3a goroutine \u5728 runtime \u4e2d\u7684\u8c03\u5ea6\u5668\u4e2d\u8fd0\u884c\u3002\u5f53\u7136 runtime \u4e5f\u4e0d\u53ea\u6709\u8c03\u5ea6\u5668\uff0c\u8fd8\u6709\u5176\u4ed6 GC \u4ec0\u4e48\u7684\u7a0b\u5e8f\u5728\u8fd0\u884c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225306\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : taowen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/talkgo.org\/t\/topic\/31 \u8bb2\u89e3 golang \u7684\u534f\u7a0b\u8c03\u5ea6\u5b9e\u73b0                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225307\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @henglinli #7 \u6211\u8865\u5145\u4e00\u70b9\u5427<\/p>\n<p>go runtime\uff0c\u4e25\u683c\u6765\u8bb2\u5c31\u662f\u4ee5 golang \u4e0b \u4ee5 goroutine \u7ed3\u5408\u7ba1\u9053\u901a\u4fe1\u7684\u5e76\u53d1\u6a21\u578b\uff0c\u8fd9\u4e2a\u5e76\u53d1\u6a21\u578b\u662f\u57fa\u4e8e stackfull \u7684\u534f\u7a0b\u6a21\u578b\uff0c\u76f8\u53cd\u7684\u662f stackless \u7684\u534f\u7a0b\u6a21\u578b\uff0c\u800c\u4f20\u7edf\u5176\u5b83\u8bed\u8a00\u53ef\u80fd\u662f\u57fa\u4e8e\u7ebf\u7a0b\u6c60\u4ee5\u53ca\u9501\u7684\u5e76\u53d1\u6a21\u578b \uff0c\u6709\u5174\u8da3\u53ef\u4ee5\u770b stackfull \u8ddf stackless \u7684\u533a\u522b\uff0c\u524d\u8005\u4f1a\u5360\u7528\u7a7a\u95f4\uff0c\u540e\u8005\u5bf9\u5185\u5b58\u7a7a\u95f4\u53cb\u597d\uff0c\u4f46\u662f\u73b0\u5728\u662f 2021 \u5e74\u4e86\uff0c\u8c01\u5bb6\u8001\u677f\u4e70\u4e0d\u8d77 2T \u5185\u5b58\uff1f golang \u9009\u7684\u662f stackfull \u534f\u7a0b\u6a21\u578b\uff0c\u5f53\u7136\u8fd9\u91cc\u6bd4\u8f83\u7b80\u5355\uff0c\u4e0b\u9762\u4f1a\u8be6\u7ec6\u4ecb\u7ecd\uff0c\u6709\u5174\u8da3\u6df1\u5165\u8fd8\u662f\u6839\u636e\u6211\u7684\u5173\u952e\u5b57\u53bb\u627e\u4e66\u770b\u3002<\/p>\n<p>\u7136\u540e stackfull \u7684\u672c\u8d28\u5c31\u662f \u6bcf\u4e2a\u534f\u7a0b\u6709\u81ea\u5df1\u7684\u6808\u5e41\uff0c\u5177\u4f53\u6211\u6ca1\u6709\u5173\u6ce8\u8fc7 goroutine \u7684\u6808\u5e41\u7ed3\u6784\uff0c\u4f46\u662f\u4ece\u6211\u89c2\u5bdf goroutine \u8fdb\u5165\u5185\u6838\u6001\u7684\u6c47\u7f16\u4ee3\u7801\uff0c\u505a\u4e86\u4e00\u6b21 go \u7684\u8c03\u7528\u7ea6\u5b9a \u5230 amd64 fastcall \u7684\u8c03\u7528\u7ea6\u5b9a\u8f6c\u6362\uff0c\u57fa\u672c\u4e0a\u53ef\u4ee5\u786e\u8ba4 golang \u5185\u90e8\u7684\u51fd\u6570\u8c03\u7528\u7ea6\u5b9a\u4ee5\u53ca\u6808\u5e41\u7ed3\u6784 \u5e94\u8be5\u662f\u5e73\u53f0\u65e0\u5173\u5316\u7684\uff0c\u53e6\u5916 golang \u8c8c\u4f3c\u662f\u4e0d\u652f\u6301\u4e8c\u8fdb\u5236 lib \u7f16\u8bd1\u7684\uff0c\u662f\u4e0d\u662f\u56e0\u4e3a\u5185\u90e8\u5927\u7248\u672c\u4e4b\u95f4\u7684 ABI \u662f\u5426\u4ece\u6765\u672a\u7a33\u5b9a\u8fc7\u3002<\/p>\n<p>\u7136\u540e\u5f04\u8fd9\u4e2a stackfull \u7684\u534f\u7a0b\u6a21\u578b\u662f\u56e0\u4e3a golang \u8fd9\u4e2a\u8bed\u8a00\u7684\u91ce\u5fc3\u5f88\u5927\uff0c\u5b83\u5e0c\u671b\u80fd\u628a\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u6001\u4efb\u52a1\u8c03\u5ea6\u8fd9\u4e2a\u4e8b\u60c5\u5168\u6743\u4ea4\u7ed9\u5e94\u7528\u6001\u7684 go \u8c03\u5ea6\u7cfb\u7edf\u6765\u4f5c\uff0c\u800c\u4e4b\u524d\u6240\u6709\u7684\u8bed\u8a00 \u5305\u62ec C++ Java C \u90fd\u662f\u5c06\u8c03\u5ea6\u6a21\u578b\u4ea4\u7ed9\u64cd\u4f5c\u7cfb\u7edf\u63d0\u4f9b\u7684\u7ebf\u7a0b\u62bd\u8c61\uff0c\u8fd9\u4e00\u70b9\u4e0a golang \u662f\u4e00\u4e2a\u4f1f\u5927\u7684\u8fdb\u6b65 \u914d\u5408\u7ba1\u9053\u8ddf\u975e\u963b\u585e\u5f0f IO \u4ee5\u53ca epoll \u8c03\u7528\uff0c\u53ef\u4ee5\u5728\u7528\u6237\u6001\u5b9e\u73b0\u4e00\u4e2a\u65e0\u9501\u4e14\u6309\u9700\u8c03\u5ea6\u7684\u8c03\u5ea6\u7cfb\u7edf\uff0c\u53ef\u4ee5\u8bf4 go \u5b83\u662f\u4e13\u95e8\u4e3a\u540e\u7aef\u670d\u52a1\u8bbe\u8ba1\u7684\uff0c\u5f53\u7136\u4ece\u8bed\u6cd5\u4e0a\u6765\u770b\uff0c\u76ee\u524d\u4e0d\u652f\u6301\u6cdb\u578b\uff0c\u6211\u6682\u65f6\u6ca1\u6709\u52a0\u5927\u5bf9 go \u8fd9\u95e8\u8bed\u8a00\u7684\u6295\u5165\uff0c\u4f46\u662f\u5b83\u8fd9\u4e2a\u8bbe\u8ba1\u7406\u5ff5\u662f\u597d\u7684\uff0c\u90a3\u5c31\u662f\u5e26\u6709\u8fd0\u884c\u65f6\u7684\u8bed\u8a00\u5e94\u8be5\u4ece\u64cd\u4f5c\u7cfb\u7edf\u90a3\u91cc\u62ff\u56de\u539f\u672c\u5c5e\u4e8e\u6211\u4eec\u5e94\u7528\u5f00\u53d1\u4eba\u5458\u7684\u8c03\u5ea6\u529f\u80fd\u3002<\/p>\n<p>\u8fd9\u91cc\u53ef\u4ee5\u63d0\u51fa\u4e24\u70b9 <\/p>\n<p>1. \u7ba1\u9053\u6a21\u578b\u4e3a\u4ec0\u4e48\u4f18\u4e8e\u9501 monitor \uff1f \u4f20\u7edf\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u63d0\u4f9b\u7684\u76d1\u89c6\u5668\u9501 \u5b58\u5728\u60ca\u7fa4\u7684\u95ee\u9898\uff0c\u8fd9\u662f\u5f88\u96be\u907f\u514d\u7684\uff0c\u56e0\u4e3a\u64cd\u4f5c\u7cfb\u7edf\u5e76\u4e0d\u77e5\u9053\u4f60\u8981\u5524\u9192\u591a\u5c11\u4e2a\u7ebf\u7a0b\uff0c\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u6307\u5b9a\u5524\u9192\u7684\u6570\u91cf\uff0c\u8fd9\u91cc\u5c31\u8981\u505a\u5230\u5f88\u7cbe\u7ec6\u5316\u7684\u9501\u5524\u9192\u64cd\u4f5c\uff0c\u4f8b\u5982 Java \u91cc\u9762\u7684 blockingQueue \u5f53\u961f\u5217\u6ee1\u4e86\u7684\u65f6\u5019 \u64cd\u4f5c\u7684\u7ebf\u7a0b\u4f1a\u53bb \u5524\u9192\u56e0\u4e3a\u8bfb\u7b49\u5f85\u7684\u7ebf\u7a0b\u800c\u4e0d\u662f\u53bb\u5524\u9192\u56e0\u4e3a\u5199\u7b49\u5f85\u7684\u7ebf\u7a0b\uff0c\u5f53\u961f\u5217\u7a7a\u4e86\u7684\u65f6\u5019\uff0c\u5f53\u524d\u64cd\u4f5c\u7ebf\u7a0b\u5c31\u4f1a\u53bb\u5524\u9192\u56e0\u4e3a\u5199\u7b49\u5f85\u7684\u7ebf\u7a0b\u800c\u4e0d\u662f\u53bb\u5524\u9192\u56e0\u4e3a\u8bfb\u7b49\u5f85\u7684\u7ebf\u7a0b\uff0c\u800c\u4e4b\u524d\u6211\u6240\u8bf4\u7684\u8fd9\u4e9b\u64cd\u4f5c\uff0c\u90fd\u9700\u8981\u5bf9\u5e76\u53d1\u7f16\u7a0b\u6709\u5f88\u9ad8\u7684\u7406\u89e3\uff0c\u4f60\u624d\u80fd\u8bbe\u8ba1\u51fa\u4e00\u4e2a\u591a\u7ebf\u7a0b\u5e76\u53d1\u4e14\u7ebf\u7a0b\u5b89\u5168\u7684\u961f\u5217\uff0c\u8fd9\u4e00\u70b9\u5bf9\u5f00\u53d1\u4eba\u5458\u8981\u6c42\u5f88\u9ad8\uff0c\u800c\u4e14\u4ece\u56e0\u4e3a\u76d1\u89c6\u5668\u9501 Java \u7684\u7ebf\u7a0b\u4f1a\u9891\u7e41\u8fdb\u5165\u5185\u6838 \u5f00\u9500\u5f88\u5927\u3002<\/p>\n<p>\u4f46\u5982\u679c\u4f7f\u7528\u7ba1\u9053\uff0c\u5176\u5b9e\u4ece golang \u8c03\u5ea6\u5668\u6765\u770b\uff0c\u5f53\u4f60\u60f3\u4ece\u4e00\u4e2a\u7ba1\u9053\u8bfb\u6570\u636e\u800c\u6302\u8d77\u7684\u65f6\u5019\uff0c\u5176\u5b9e golang \u8c03\u5ea6\u5668\u53ea\u8981\u628a\u5f53\u524d\u7ebf\u7a0b\u7684\u51e0\u4e2a\u5bc4\u5b58\u5668\u6362\u6389\u5c31\u80fd\u628a\u5bf9 CPU \u7684\u63a7\u5236\u6743\u8f6c\u79fb\u5230\u53e6\u5916\u4e00\u4e2a\u534f\u7a0b\u4e0a\uff0c\u8fd9\u4e2d\u95f4\u65e0\u9700\u8fdb\u5165\u5185\u6838\u8c03\u5ea6\uff0c\u800c\u4e14 golang \u8fd8\u53ef\u4ee5\u505a\u4e00\u4e9b\u4f18\u5316\uff0c\u628a\u5bf9 CPU \u7684\u63a7\u5236\u5668\u4f18\u5148\u914d\u7ed9\u9700\u8981\u5199\u8fd9\u4e2a\u7ba1\u9053\u7684\u534f\u7a0b\uff0c\u6216\u8005\u628a\u5bf9\u540c\u4e00\u4e2a\u7ba1\u9053\u8bfb\u5199\u7684\u534f\u7a0b\u90fd\u5206\u914d\u5230\u4e00\u4e2a CPU \u4e0a\uff0c\u8fd9\u6837\u4e00\u6765 golang \u4f7f\u7528\u7ba1\u9053\u53ef\u4ee5\u5b9e\u73b0\u5b8c\u5168\u65e0\u9501\u5316\u7684\u534f\u7a0b\u4e4b\u95f4\u7684\u901a\u4fe1\uff0c\u4f46\u662f\u4ece\u7f16\u5199 golang \u7684\u534f\u7a0b\u4ee3\u7801\u7684\u4eba\u6765\u770b\uff0c\u4ed6\u7684\u5927\u8111\u8d1f\u62c5\u5c31\u4f1a\u5c11\u5f88\u591a\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225308\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7b2c\u4e8c\u70b9 \u6211\u5f85\u4f1a\u4e0b\u5348\u8865\u5145                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225309\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5bf9\u4e8e C10K \u95ee\u9898                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225310\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Dongxiem <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8c22\u8c22\u4ee5\u4e0a\u5927\u4f6c\u4eec\u7684\u56de\u590d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225311\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : love2020 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lewis89 \u542c\u4e0d\u61c2 \u6709\u70b9\u96be\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225312\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @love2020 #14 \u6ca1\u4e8b\uff0c\u591a\u641c\u7d22\u5c31\u597d\u4e86.. <\/p>\n<p>\u6211\u5206\u4eab\u7684 \u53ef\u80fd\u5e7f\u5ea6 \u6df1\u5ea6\u90fd\u6709\uff0c <br \/>\u53ef\u80fd\u5f88\u591a\u4eba \u6839\u672c\u4e0d\u77e5\u9053 ABI monitor \u76d1\u89c6\u5668 \u6808\u5e41 fastcall stackfuul stackless \u8fd9\u79cd\u4e1c\u897f\uff0c<br \/>\u4f60\u5982\u679c\u8ba1\u7b97\u673a\u4f53\u7cfb\u7ed3\u6784 \u90fd\u4e86\u89e3\u7684\u8bdd\uff0c\u5c31\u4e0d\u4f1a\u4ea7\u751f\u8fd9\u79cd\u7591\u60d1\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225313\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 1011 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lewis89 \u5efa\u8bae\u5927\u4f6c\u6574\u7406\u4e00\u4e0b\u5355\u72ec\u6210\u6587                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225314\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @1011 #16 \u5176\u5b9e\u4e5f\u4e0d\u662f\u4f18\u96c5\u7684\u95ee\u9898\uff0c\u4ee5\u524d\u7ebf\u7a0b\u7684\u901a\u4fe1\uff0c\u80af\u5b9a\u4f7f\u7528\u76d1\u89c6\u5668\u9501\u53bb\u505a\uff0c\u8fd9\u6837 \u8c03\u5ea6 \u540c\u6b65\u90fd\u662f\u5185\u6838\u6765\u5b8c\u6210\u7684\uff0c\u5e94\u7528\u6001\u7684\u8bed\u8a00\u5305\u62ec\u6211\u4eec\u5e94\u7528\u7a0b\u5e8f\u5458\u90fd\u662f\u6ca1\u6709\u6539\u9020\u6743\u9650\u7684\uff0cgolang \u505a\u7684\u4e00\u4e2a\u4e8b\u60c5\u5c31\u662f\u628a\u539f\u672c\u8ba9\u5185\u6838\u5e72\u7684\u4e8b\u60c5\uff0c\u90fd\u593a\u56de\u6765\u6765\u8ba9\u5e94\u7528\u5c42\u81ea\u5df1\u6765\u5e72\uff0c\u56e0\u4e3a\u64cd\u4f5c\u7cfb\u7edf\u5176\u5b9e \u63d0\u4f9b\u50cf\u4fe1\u53f7\u8fd9\u79cd\u4e2d\u65ad\u673a\u5236\uff0c\u5c31\u7c7b\u4f3c CPU \u63d0\u4f9b\u7ed9\u64cd\u4f5c\u7cfb\u7edf\u7684\u65f6\u949f\u4e2d\u65ad\u4e00\u6837\uff0c\u4e5f\u5c31\u662f go \u8c03\u5ea6\u5668 \u5e72\u4e86\u539f\u672c\u5f52\u5185\u6838\u7684\u4e8b\u60c5.. \u5e72\u4e86\u4e4b\u540e \u6211\u4eec\u5c31\u53ef\u4ee5\u81ea\u5df1\u4f18\u5316\u7b56\u7565\uff0c\u6216\u8005\u7528\u5176\u5b83\u7684\u62bd\u8c61 \u4f8b\u5982\u7ba1\u9053 \u6765\u66ff\u4ee3\u9501\u8fd9\u79cd\u62bd\u8c61                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225315\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Dongxiem <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @taowen \u591c\u8bfb\u8fd9\u4e00\u671f\u662f\u8bb2\u4e86\u8c03\u5ea6\u6a21\u578b\uff0c\u4f46\u662f\u5173\u4e8e runtime \u7684\u5177\u4f53\u8fd8\u662f\u6ca1\u6709\u6d89\u53ca\u5230\uff0c\u6bd4\u5982\u4e0a\u9762\u51e0\u4e2a\u95ee\u9898\u4f3c\u4e4e\u5728\u8fd9\u4e2a\u89c6\u9891\u5f53\u4e2d\u627e\u4e0d\u5230\u7b54\u6848\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225316\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Dongxiem #18 runtime \u5f53\u7136 \u8fd8\u6709 \u5783\u573e\u56de\u6536\u5668.. \u5fd8\u8bb0\u8bb2\u4e86 \u5783\u573e\u56de\u6536\u4e5f\u662f runtime \u4e00\u90e8\u5206                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225317\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Dongxiem <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @henglinli <br \/>\u201cruntime \u8fd0\u884c\u5728 OS \u7ebf\u7a0b\u4e0a,\u6bd4\u5982 pthread \u3002\u53c2\u89c1 https:\/\/github.com\/golang\/gofrontend\/blob\/master\/libgo\/runtime\/go-libmain.c#L208<\/p>\n<p>go \u8fdb\u7a0b\u5e94\u8be5\u662f goroutine \u5427\u3002\u8fd9\u4e2a\u771f\u4e0d\u597d\u56de\u7b54\u3002\u6709\u5f88\u591a\u4e2a\uff0c\u4f46\u81f3\u5c11\u6709\u4e00\u4e2a runtime.main\uff0c\u81f3\u4e8e\u6700\u591a\u6709\u591a\u5c11\u4e2a\uff0c\u5982\u679c golang \u5b9e\u73b0\u8005\u8003\u8651\u8fc7\u8fd9\u4e2a\u95ee\u9898\u7684\u8bdd\uff0c\u4f1a\u6709\u4e00\u4e2a\u53ef\u4ee5\u8bbe\u7f6e\u7684\u53c2\u6570\u7684\uff0c\u53ef\u4ee5\u7528\u73af\u5883\u53d8\u91cf GOMAXPROCS \u9650\u5236 OS \u7ebf\u7a0b\u6570\u3002\u201d<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>\u8bf7\u95ee\u4e0a\u8ff0\u5185\u5bb9\uff0c\u662f\u4e0d\u662f\u53ef\u4ee5\u8ba4\u4e3a\u4f60\u89c9\u5f97\u662f\u4e00\u4e2a OS \u7ebf\u7a0b\u5c31\u6709\u4e00\u4e2a runtime \u5462\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225318\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Dongxiem <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lewis89 \u662f\u7684\uff0c\u5173\u4e8e runtime \u5305\u542b\u7684\u4e1c\u897f\u5f88\u591a\uff0c\u6bd4\u5982\u4f60\u8bf4\u7684 channel \u3001\u8c03\u5ea6\u6a21\u578b\u3001\u5783\u573e\u56de\u6536\u7b49\uff0c\u4f46\u662f\u6211\u8fd8\u662f\u89c9\u5f97 Runtime \u6700\u5f00\u59cb\u7684\u51e0\u4e2a\u5185\u5bb9\u8fd8\u662f\u4e0d\u592a\u6e05\u6670\uff0c\u5982 runtime \u7a76\u7adf\u8fd0\u884c\u5728\u54ea\u91cc\u5462\uff1f\u5982\u679c\u6309\u7167 @henglinli \u7684\u8bf4\u6cd5\uff0c\u662f\u4e0d\u662f\u5728 GMP \u6a21\u578b\u4e2d runtime \u8fd0\u884c\u5728\u6bcf\u4e2a M \u7cfb\u7edf\u7ebf\u7a0b\u4e0a\uff1f\u6bcf\u4e2a M \u90fd\u627f\u8f7d\u7740\u4e00\u4e2a runtime \u8fdb\u884c\u5e76\u53d1\u8c03\u5ea6\uff1f\u8fd8\u662f\u8bf4 runtime \u53ea\u662f\u8fd0\u884c\u5728\u4e00\u4e2a\u521d\u59cb\u7684\u7cfb\u7edf\u7ebf\u7a0b M0 \u4e0a\uff0c\u7136\u540e\u518d\u8fdb\u884c\u6307\u6325\u8c03\u5ea6\u6240\u6709\u7684\u7ebf\u7a0b\u3001\u534f\u7a0b\u7b49\uff1b<\/p>\n<p>\u800c\u4e14\u5173\u4e8e Runtime \u7684\u521b\u5efa\u53ca\u8fd0\u884c\u8fc7\u7a0b\uff0cGoogle \u4e0a\u9762\u51e0\u4e4e\u4e5f\u641c\u7d22\u4e0d\u5230\uff0c\u90fd\u662f\u5728\u5c06 GMP \u7684\u8c03\u5ea6\u6a21\u578b\u7b49\u7b49\u7684\u5185\u5bb9\uff0c\u5e76\u6ca1\u6709\u6d89\u53ca\u5230\u6700\u5f00\u59cb\u7684\u90e8\u5206\u5185\u5bb9\u3002\u5982\u679c\u4f60\u89c9\u5f97\u53ef\u4ee5\u4e86\u89e3\u5230\u7684\u4e00\u4e9b\u535a\u5ba2\uff0c\u8bf7\u63a8\u8350\u4e00\u4e0b\u554a\uff0c\u8c22\u8c22\u5927\u4f6c\u4e86\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225319\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Dongxiem #21 \u8fd9\u4e2a\u4f60\u8981\u4e86\u89e3 runtime \u6bcf\u4e2a\u7ec6\u8282\u7684\u8bdd\uff0c\u53ea\u80fd\u53bb\u770b\u6e90\u4ee3\u7801\u4e86\uff0c \u6211\u53ea\u662f\u63d0\u4f9b\u4e00\u4e9b\u5927\u81f4\u4e0a\u7684\u601d\u8def\uff0c\u56e0\u4e3a\u5f88\u591a\u4e1c\u897f\u9053\u7406\u662f\u4e00\u6837\u7684\uff0c\u4f8b\u5982\u5783\u573e\u56de\u6536 \u80af\u5b9a\u8981\u6682\u505c goroutine \u7ef4\u6301 \u53d8\u91cf\u4e4b\u95f4\u7684\u5f15\u7528\u5173\u7cfb\u7684\u4e00\u81f4\u6027\uff0c\u4e0d\u7136\u4f60\u4e00\u8fb9\u5728\u4fee\u6539\u53d8\u91cf\u5f15\u7528\u5173\u7cfb \u53c8\u8fdb\u884c\u5783\u573e\u56de\u6536 \u662f\u4e0d\u73b0\u5b9e\u7684..                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225320\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : weiwenhao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             runtime.collector()                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225321\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xbh1794970183564 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8001\u54e5\u5934\u50cf\u80fd\u53d1\u4e00\u5f20\u5417\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225322\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : weiwenhao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6ca1\u770b\u8fc7\u6e90\u7801\uff0c\u4f46\u662f\u770b\u8fc7\u4e00\u4e2a\u5783\u573e\u56de\u6536\u7684\u6559\u7a0b\uff0c\u6211\u89c9\u5f97\u5e94\u8be5\u4f1a\u6709\u7c7b\u4f3c\u8fd9\u6837\u7684\u5b9e\u73b0(\u4e0a\u9762\u8fd8\u6ca1\u6253\u5b8c\u5c31\u53d1\u51fa\u53bb\u4e86\u4e5f\u4e0d\u80fd\u5220\u9664)<\/p>\n<p>movl $4096, %rdi<br \/>call runtime.alloc # \u8c03\u7528 runtime \u4e2d\u7684\u5783\u573e\u56de\u6536\u51fd\u6570<br \/>movl $1, -4($rax)<br \/>movl $2, -8($ax)<br \/>&#8230;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225323\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Lemeng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lewis89 \u671f\u5f85\u8001\u54e5\u8865\u5145                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225324\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Dongxiem <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lewis89 \u662f\u7684\uff0c\u8fd9\u4e2a\u95ee\u9898\u7684\u672c\u610f\u5c31\u662f\u4e86\u89e3 runtime \u7684\u521d\u59cb\u5316\u3001\u8fd0\u884c\u7b49\u5e95\u5c42\u539f\u7406\uff0c\u4f60\u56de\u7b54\u7684 GMP \u3001CSP \u3001GC \u7b49\u5185\u5bb9\u4e5f\u662f runtime \u7684\u539f\u7406\uff0c\u4f46\u662f\u8fd8\u662f\u6ca1\u80fd\u89e3\u51b3\u5230\u4e0a\u9762\u4e00\u5f00\u59cb\u7684\u51e0\u4e2a\u95ee\u9898\u554a\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225325\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Dongxiem <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xbh1794970183564 \u8fd9\u4e0d\u77e5\u9053\u8981\u548b\u53d1\u554a\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225326\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : weiwenhao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @weiwenhao<\/p>\n<p>var a []int \/\/ \u7533\u8bf7\u4e00\u4e2a\u52a8\u6001\u6570\u7ec4<br \/>a = append(a, 22222222)<br \/>a = append(a, 33333333)<\/p>\n<p>\u7c7b\u4f3c\u8fd9\u6837\u7684 golang \u4ee3\u7801\u4f1a\u8f6c\u6210\u4e0a\u9762\u4f60\u7684\u6c47\u7f16\uff0c\u53e6\u5916\u6c47\u7f16\u662f\u53ef\u4ee5\u8c03\u7528 c \u51fd\u6570\u7684\uff0c\u53ea\u8981\u6309\u7167 c \u8c03\u7528\u7ea6\u5b9a\u5c31\u53ef\u4ee5\u4e86\u3002runtime.alloc \u65e0\u975e\u5c31\u662f\u8c03\u7528 c \u7684 malloc \u51fd\u6570\u7533\u8bf7\u4e00\u4e2a 4096 \u5b57\u8282\u7684\u7a7a\u95f4\uff0c\u7136\u540e\u8fd4\u56de\u6307\u9488\u5730\u5740\u7ed9 %rax(\u8c03\u7528\u7ea6\u5b9a)\u3002<\/p>\n<p>&#8212;&#8211;go tool compile -S main.go \u867d\u7136\u6ca1\u770b\u592a\u61c2\uff0c\u4f46\u662f\u5927\u6982\u662f\u8fd9\u6837<\/p>\n<p> 0x0046 00070 (main.go:5) CALL runtime.growslice(SB) #\u8c03\u7528 runtime \u51fd\u6570\u5f97\u5230\u4e00\u6bb5\u5806\u5185\u5b58\u7a7a\u95f4<br \/> 0x004b 00075 (main.go:5) MOVQ 40(SP), AX<br \/> 0x0050 00080 (main.go:5) MOVQ 48(SP), CX<br \/> 0x0055 00085 (main.go:5) MOVQ 56(SP), DX<br \/> 0x005a 00090 (main.go:5) MOVQ $22222222, (AX) # \u6839\u636e\u6307\u9488\u504f\u79fb\u5199\u5165\u5230\u5806\u5185\u5b58<br \/> 0x0061 00097 (main.go:6) LEAQ 2(CX), BX<br \/> 0x0065 00101 (main.go:6) CMPQ DX, BX<br \/> 0x0068 00104 (main.go:6) JCS 125<br \/> 0x006a 00106 (main.go:6) MOVQ $33333333, 8(AX)(CX*8) # \u6839\u636e\u6307\u9488\u504f\u79fb\u5199\u5165\u5230\u5806\u5185\u5b58                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225327\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Dongxiem #27 \u8fd0\u884c\u65f6\u7684\u539f\u7406\uff1f\u6211\u4e0d\u77e5\u9053\u4f60\u63d0\u51fa\u7684\u95ee\u9898 \u5177\u4f53\u662f\u4ec0\u4e48\uff0c\u4ee3\u7801\u65e0\u975e\u662f\u8fd0\u884c\u5728 ring3 \u7528\u6237\u6001\u4e0a\uff0c\u57fa\u672c\u4e0a\u6240\u6709\u64cd\u4f5c\u90fd\u662f\u8981\u7528\u64cd\u4f5c\u7cfb\u7edf \u63d0\u4f9b\u7684 API\uff0c\u521d\u59cb\u5316\uff1f \u521d\u59cb\u5316\u5c31\u66f4\u7b80\u5355\u4e86 malloc \u4e00\u4e2a\u8fde\u7eed\u5185\u5b58\u5730\u5740 \u5c31\u80fd\u5f53\u505a\u534f\u7a0b\u7684\u6808\u5e27\u4f7f\u7528\uff0c\u6808\u5e41\u53ea\u662f\u4e00\u4e2a\u903b\u8f91\u7684\u6982\u5ff5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225328\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xbh1794970183564 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Dongxiem \u6709\u539f\u94fe\u63a5\u5417\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225329\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Dongxiem #27 \u7136\u540e\u8c03\u5ea6\u4ee3\u7801\u7684\u8bdd \u6bcf\u4e00\u4e2a M \u90fd\u662f\u6709\u81ea\u5df1\u7684 \u7ebf\u7a0b\u6808\u5e41\u7684\uff0c\u8c03\u5ea6\u7684\u65f6\u5019 \u6709\u8c03\u5ea6\u961f\u5217\uff0c\u4e0d\u540c\u7684 M \u53ef\u4ee5\u53bb\u5176\u5b83 M \u7684\u961f\u5217\u91cc\u9762\u53bb\u5077 goroutine \u6267\u884c\uff0c\u8fd9\u53ef\u4ee5\u7406\u89e3\u5417\uff1f\u56e0\u4e3a\u6682\u505c goroutine \u7684\u8bdd \u53ea\u8981\u4fdd\u5b58 goroutine \u7684\u534f\u7a0b\u6808\u5e41\u5c31\u597d\u4e86..                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225330\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Dongxiem #27 \u6211\u89c9\u5f97\u4f60\u53ef\u80fd\u5bf9 M \u8fd9\u4e2a\u62bd\u8c61\u7684\u6982\u5ff5\u6ca1\u7406\u89e3\u6e05\u695a\uff0c\u6bcf\u4e2a M \u5b9e\u9645\u4e0a\u5c31\u662f\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u7ebf\u7a0b\uff0c\u5b83\u81ea\u5df1\u6709\u81ea\u5df1\u7684\u7ebf\u7a0b\u6808\u5e41\uff0c\u7136\u540e\u5b83\u62ff\u5230 goroutine \u7684\u65f6\u5019 \u53ef\u4ee5\u628a \u5bc4\u5b58\u5668\u4fdd\u5b58\u8d77\u6765\uff0c\u7136\u540e\u628a goroutine \u7684\u534f\u7a0b\u4e0a\u4e0b\u6587\u7b49\u5bc4\u5b58\u5668\u53d8\u91cf\u6362\u4e0a\u53bb\uff0c\u7136\u540e\u628a\u5bf9 CPU \u7684\u63a7\u5236\u6743 \u4ea4\u7ed9 goroutine (\u5728\u6c47\u7f16\u5c42\u9762\u4e0a \u53ef\u80fd\u5c31\u662f JMP \u5230 goroutine \u7684\u4ee3\u7801 \u6062\u590d goroutine \u4e4b\u524d\u88ab\u6682\u505c\u65f6\u7684\u4e0a\u4e0b\u6587\u72b6\u6001) .. \u7136\u540e goroutine \u8fd0\u884c\u5230\u4e00\u5b9a\u65f6\u5019 \u4f8b\u5982\u8c03\u7528\u65b9\u6cd5 \u6216\u8005 \u4f7f\u7528\u7f51\u7edc IO \u5b83\u4f1a\u81ea\u52a8\u628a\u5bf9 CPU \uff08\u7ebf\u7a0b\uff09\u7684\u63a7\u5236\u6743 \u8ba9\u7ed9 M \u7684\u8c03\u5ea6\u4ee3\u7801.. \u6216\u8005 goroutine \u957f\u671f\u5360\u7528\u7ebf\u7a0b\u4e0d\u653e\uff0c\u8fd9\u4e2a\u65f6\u5019\u4f1a\u6709\u64cd\u4f5c\u7cfb\u7edf\u63d0\u4f9b\u7684\u4fe1\u53f7\u4e2d\u65ad\u673a\u5236 \u5f3a\u884c\u8feb\u4f7f goroutine \u653e\u5f03\u5bf9 CPU \u7684\u63a7\u5236\u6743\uff0c\u7136\u540e\u4ee3\u7801\u4f1a\u8df3\u56de\u5230\u8c03\u5ea6\u5668 \u91cd\u65b0\u8fdb\u884c\u8c03\u5ea6..                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225331\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Dongxiem #21 \u4f60\u5982\u679c\u8981\u5b8c\u5168\u7406\u89e3 goroutine \u4ee3\u7801 \u8c03\u5ea6\u5668\u4ee3\u7801 \u8c01\u63a7\u5236\u4e86\u7ebf\u7a0b\uff08 CPU \uff09\u63a7\u5236\u6743\u7684\u8bdd\uff0c\u6700\u597d\u53bb\u8bfb X86 \u6c47\u7f16\u8ddf\u62a2\u5360\u5f0f\u8c03\u5ea6\u539f\u7406\uff0c\u56e0\u4e3a\u65e0\u8bba\u534f\u7a0b \u7ebf\u7a0b\u90fd\u662f\u62bd\u8c61\u7684\u6982\u5ff5\uff0c\u53ea\u8981\u80fd\u4fdd\u5b58\u5176\u4e0a\u4e0b\u6587 \u4f8b\u5982\u7ebf\u7a0b\u53ea\u8981\u64cd\u4f5c\u7cfb\u7edf\u4fdd\u5b58 RSP RBP IP \u5bc4\u5b58\u5668 CPU \u5c31\u80fd\u5728\u7ebf\u7a0b\u4e4b\u95f4 \u4e0d\u65ad\u6765\u56de\u5207\u6362\uff0c\u53e6\u5916\u64cd\u4f5c\u7cfb\u7edf\u5728\u8fdb\u7a0b\u4e4b\u95f4\u5207\u6362 \u53ef\u80fd\u8fd8\u8981\u4fee\u6539 CR3 \u5bc4\u5b58\u5668 \u56e0\u4e3a\u6bcf\u4e2a\u8fdb\u7a0b\u7684\u5185\u5b58\u5730\u5740\u7a7a\u95f4\u4e0d\u4e00\u6837\uff0c\u4f46\u662f\u5bf9\u4e8e\u534f\u7a0b\u6765\u8bb2\uff0c\u6211\u4e0d\u6e05\u695a\u534f\u7a0b\u5185\u90e8\u662f\u5982\u4f55\u7ef4\u62a4\u6808\u5e41\u7684\uff0c\u4f46\u662f\u539f\u7406\u80af\u5b9a\u662f\u76f8\u540c\u7684\uff0c\u65e0\u975e\u662f\u4fdd\u5b58\u5f53\u524d\u8fd0\u884c\u72b6\u6001\u7684\u5bc4\u5b58\u5668\u8ddf\u5404\u79cd\u4e0a\u4e0b\u6587\u7684\u4e1c\u897f \u4ee5\u4fbf\u5207\u6362\u56de\u6765\u7684\u65f6\u5019 \u4f7f\u7528..                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225332\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Dongxiem <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xbh1794970183564 \u53bb\u8fd9\u91cc\u627e\uff1a https:\/\/medium.com\/a-journey-with-go\uff0c\u91cc\u9762\u5f88\u591a go \u7684\u914d\u56fe\uff0c\u5305\u4f60\u559c\u6b22\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225333\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xbh1794970183564 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Dongxiem \u611f\u8c22                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225334\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @weiwenhao #29 \u8fd9\u4e2a\u8981\u770b\u662f\u7528 \u5f15\u7528\u8ba1\u6570 \u8fd8\u662f \u53ef\u8fbe\u6027\u5206\u6790\uff0c\u5982\u679c\u662f\u5f15\u7528\u8ba1\u6570\u7684\u8bdd \u90a3\u5c31\u662f\u8ddf python \u4e00\u6837\uff0c\u6bcf\u4e2a\u5bf9\u8c61\u6709\u4e00\u4e2a\u5f15\u7528\u8ba1\u6570\u5668\uff0c\u5f53\u5b83\u53d8\u6210 0 \u7684\u65f6\u5019 \u8fd9\u6837\u5c31\u80fd\u56de\u6536\uff0c\u5982\u679c\u662f\u53ef\u8fbe\u6027\u5206\u6790\uff0c\u90a3\u5c31\u8981\u5224\u65ad\u5f53\u524d\u7a0b\u5e8f\u8fd0\u884c\u65f6\u8fd9\u4e2a\u72b6\u6001\u54ea\u4e9b\u5bf9\u8c61\u662f\u4e0d\u80fd\u88ab\u56de\u6536\u7684\uff0c\u4f8b\u5982\u6211 A-&gt;B-&gt;C \u4e09\u4e2a\u65b9\u6cd5\u8c03\u7528 C \u65b9\u6cd5\u5728\u6267\u884c\u78c1\u76d8 IO\uff0c\u6b64\u65f6 A \u8ddf B \u7684\u4e34\u65f6\u53d8\u91cf\u5f15\u7528\u6216\u8005\u95f4\u63a5\u5f15\u7528\u7684\u5806\u4e0a\u9762\u7684\u5185\u5b58\u7a7a\u95f4 \u4f60\u662f\u6ca1\u6cd5\u6807\u8bb0\u56de\u6536\u7684\uff0c\u5982\u679c\u6807\u8bb0\u56de\u6536\u4e86 C \u65b9\u6cd5\u4ece\u5185\u6838\u8fd4\u56de\u56de\u6765 A \u8ddf B \u53d1\u73b0\u81ea\u5df1\u7684\u4e34\u65f6\u53d8\u91cf\u6216\u8005\u5bf9\u8c61\u90fd\u4e0d\u89c1\u4e86..\u90a3\u5c31\u51fa\u95ee\u9898\u4e86\uff0c\u8fd8\u6709\u4e00\u4e9b\u5168\u5c40\u53d8\u91cf\u4e5f\u662f\u4e0d\u80fd\u88ab\u56de\u6536\u7684\uff0c\u56e0\u4e3a\u5168\u5c40\u53d8\u91cf\u7684\u751f\u547d\u5468\u671f\u53ef\u80fd\u8de8\u8d8a\u6574\u4e2a\u7a0b\u5e8f\u7684\u8fd0\u884c\u5468\u671f\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225335\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kksco <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lewis89 \u8001\u54e5\u5efa\u4e2a\u5fae\u4fe1\u7fa4\u5457\uff0c\u62c9\u70b9 v \u53cb\u8ddf\u4f60\u5b66\u4e60\u5b66\u4e60                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225336\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @kksco #38 \u6211\u6709\u5439\u6c34\u7fa4\u7684 \u4f60\u53d1\u4e0b id \u6211\u62c9\u4f60\u8fdb\u53bb..                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225337\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : weiwenhao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5bf9\u4e8e\u9759\u6001\u8bed\u8a00\u800c\u8a00 runtime \u5176\u5b9e\u5c31\u662f\u4e00\u4e2a\u5e2e\u52a9\u51fd\u6570\u5e93\uff08 runtime.go \uff09\u3002<br \/>golang \u7528\u6237\u4ee3\u7801\u7f16\u8bd1\u6210\u6c47\u7f16\uff0c\u7136\u540e\u94fe\u63a5\u8fd9\u4e2a\u5e2e\u52a9\u51fd\u6570\u5e93(runtime.go)\u3002 \u6700\u540e\u5f97\u5230\u4e00\u6574\u4e2a\u5b8c\u6574\u7684\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<p>\u6240\u4ee5 runtime \u548c\u4f60\u81ea\u5df1\u5199\u7684 golang \u4ee3\u7801\u5e76\u6ca1\u5565\u592a\u5927\u7684\u533a\u522b\u3002\u7528\u6237\u4ee3\u7801\u8c03\u7528 runtime \u4e2d\u7684\u5e2e\u52a9\u51fd\u6570\uff0c\u51fd\u6570\u6267\u884c\u5b8c\u4e86\u8fd4\u56de\u3002 \u7528\u6237\u4ee3\u7801\u8c03\u7528 import \u4e2d\u7684\u51fd\u6570\uff0c\u51fd\u6570\u6267\u884c\u5b8c\u4e86\u5c31\u8fd4\u56de\u4e86\u3002\u90fd\u4e00\u6837\u7684\u5457\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225338\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : love2020 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lewis89 \u6211\u8981\u8fdb\u7fa4\uff0cqq \u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225339\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : love2020 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lewis89 \u770b\u5230\u4e86\u6df1\u4e0d\u53ef\u6d4b\u7684\u6280\u672f \uff08 ps\uff1a\u6211\u8981\u8fdb\u7fa4\uff09                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225340\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @love2020 #42 \u6ca1\u6709\u4ec0\u4e48\u6df1\u4e0d\u53ef\u6d4b\u7684.. \u4f60\u5982\u679c\u53bb\u8bfb\u4e00\u4e0b linux 0.12 \u7684\u4ee3\u7801 \u57fa\u672c\u4e0a\u90fd\u61c2\u4e86.. \u5fae\u4fe1\u7fa4..                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225341\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : henglinli <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Dongxiem \u4e0d\u662f\u3002<br \/>runtime \u5176\u5b9e\u662f runtime dependence \u8fd0\u884c\u65f6\u4f9d\u8d56\u3002<br \/>\u4f60\u5199\u4e86\u4e00\u4e2a\u7a7a\u7684 main.main \u51fd\u6570\uff0c\u7f16\u8bd1\u5668\u5957\u4ef6\u9690\u5f0f\u94fe\u63a5\u7684\u90a3\u4e00\u90e8\u5206\u5c31\u662f runtime\uff0c\u6070\u597d\u8fd9\u4e00\u90e8\u5206\u4e5f\u662f runtime \u5305\u3002<br \/>\u5728\u51fd\u6570\u5c42\u9762\u4e0a\uff0cruntime \u5305\u91cc\u9762\u7684\u51fd\u6570\u90fd\u662f runtime \uff1b\u5728\u64cd\u4f5c\u7cfb\u7edf\u5c42\u9762\u4e0a\uff0c\u4f60\u770b\u5230\u7684 go \u7a0b\u5e8f\u6267\u884c\u7684\u7ebf\u7a0b\u90fd\u662f runtime \u5305\u91cc\u9762\u7684\u51fd\u6570\u901a\u8fc7\u7cfb\u7edf\u8c03\u7528\u521b\u5efa\u7684\u3002<br \/>\u4f60\u5199\u7684\u4ee3\u7801\u53ea\u662f\u88ab runtime.mian \u8c03\u7528\u800c\u5df2\uff0c\u5f53\u4f60\u7f16\u8bd1\u94fe\u63a5\u51fa\u4e00\u4e2a golang \u7f16\u5199\u7684\u7a0b\u5e8f\uff0cruntime \u5305\u88ab\u9690\u5f0f\u7684\u94fe\u63a5\u8fdb\u53bb\uff0c\u4e0d\u9700\u8981\u4f60\u5728\u4ee3\u7801\u91cc import\uff0c\u56e0\u4e3a\u6240\u4ee5\u7684\u5176\u4ed6\u4ee3\u7801\u90fd\u4f9d\u8d56 runtime \u5305\u3002<\/p>\n<p>\u6211\u8bf4\u4e0d\u597d\u56de\u7b54\u65f6\uff0c\u65e2\u8981\u8003\u8651\u4f60\u60f3\u8981\u95ee\u4ec0\u4e48\uff0c\u53c8\u8981\u8003\u8651\u6211\u77e5\u9053\u4ec0\u4e48\uff0c\u8fd8\u8981\u8003\u8651\u7bc7\u5e45\u7b49\u3002\u7a0b\u5e8f\u6ca1\u6709\u8fdb\u5185\u5b58\u524d\u53ea\u662f\u51fd\u6570\uff0c\u4f60\u95ee\u201c\u8fd0\u884c\u201d\u5f53\u7136\u662f\u8fdb\u5185\u5b58\u540e\u4e86\uff0c\u8fd9\u4e9b runtime \u51fd\u6570\u90fd\u88ab OS \u7ebf\u7a0b\u8c03\u7528\u6267\u884c\uff0c\u6240\u4ee5\u6211\u56de\u5230 runtime \u8dd1\u5728 OS \u7ebf\u7a0b\u4e0a\u3002\u4f46\u662f\u6709\u53ef\u80fd\uff0c\u4f60\u662f\u60f3\u95ee runtime \u662f\u5728\u54ea\u91cc\u8c03\u7528\u7684\u3002\u4e0d\u662f\u4f60\u7684\u51fd\u6570\u8c03\u7528 runtime\uff0c\u800c\u662f runtime \u8c03\u7528\u4f60\u7684\u51fd\u6570\uff0c\u5148\u6267\u884c runtime\uff0cruntime \u7cfb\u7edf\u8c03\u7528\u521b\u5efa OS \u7ebf\u7a0b\u540e\uff0c\u518d\u8c03\u7528 main.main \u4e2d\u4f60\u7684\u51fd\u6570\u3002<\/p>\n<p>gccgo \u7684 runtime \u53e6\u5f53\u522b\u8bba\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225342\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : byte10 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @1011 \u6709\u5565\u4f18\u96c5\uff0c\u53c8\u4e0d\u80fd\u521b\u5efa\u7ebf\u7a0b\uff0c\u6b7b\u5751\u8d27 go \u3002\u6211\u90fd\u660e\u77e5\u9053\u8fd9\u884c\u4ee3\u7801\u662f\u963b\u585e\u7684\uff0c\u5b83\u5c31\u662f\u4e0d\u8ba9\u6211\u521b\u5efa\u7ebf\u7a0b\u8dd1\uff0c\u5728\u534f\u7a0b\u8dd1\uff0c\u6d6a\u8d39\u65f6\u95f4\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225343\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : janxin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u9762\u8bd5\u5b98\u4ee5\u524d\u7528 Java \u7684\uff1f&#8230;.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225344\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qieqie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u660e\u660e\u4e3b\u95ee\u7684 runtime\uff0c\u6b6a\u5230\u5e76\u53d1\u6a21\u578b\u8fd8\u80fd\u6b6a\u8fd9\u4e48\u591a\u3002\u8fd9\u91cc\u5c31\u662f i \u77e5\u4e4e\u5417\uff0ci \u4e86 i \u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225345\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kksco <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lewis89 wx: MTMxNzM2ODAwMTg=                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225346\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : saberlong <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @byte10 runtime.LockOSThread()                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225347\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Dongxiem <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lewis89 \u8c22\u8c22\u5927\u4f6c\u7684\u56de\u7b54\uff5e                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225348\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Dongxiem <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @henglinli \u6211\u89c9\u5f97\u4f60\u56de\u7b54\u7684\u5f88\u7b26\u5408\u95ee\u9898\u4e86\uff0c\u8c22\u8c22\u5927\u4f6c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225349\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Dongxiem <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @weiwenhao \u662f\u7684\uff0c\u8ba4\u8bc6\u5230\u4e86\uff0c\u7406\u89e3\u6765\u8bf4\u5c31\u662f\u4e00\u4e2a\u5e93\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225350\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @byte10 #45 \u4e3a\u4ec0\u4e48\u8981\u521b\u5efa\u7ebf\u7a0b\uff0c\u800c\u4e14\u4f7f\u7528\u8bfb\u5199\u78c1\u76d8\u6587\u4ef6\u8fd9\u79cd\u963b\u585e\u5f0f IO \u7684\u8bdd\uff0cgoroutine \u5c01\u88c5\u4e86 syscall\uff0c\u4f1a\u81ea\u52a8\u5206\u79bb M \u8ddf G\uff0c\u81ea\u52a8\u521b\u5efa\u7ebf\u7a0b\u53bb\u5e94\u4ed8\u8fd9\u79cd\u963b\u585e\u5f0f IO\uff0c\u4e0d\u6bd4\u4f60\u624b\u52a8\u53bb\u521b\u5efa\u7ebf\u7a0b\u5f3a 100 \u500d\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225351\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @qieqie #47 <\/p>\n<p>i \u5c31 i \u4e86\u5427\uff0c\u6bcf\u4e2a\u4eba\u5bf9 runtime \u8fd9\u4e2a\u6982\u5ff5\u7406\u89e3\u5b8c\u5168\u4e0d\u4e00\u6837\uff0c\u4f46\u662f\u6211\u4eec\u4e00\u822c\u7f51\u4e0a\u4ea4\u6d41 runtime \u65e0\u975e\u662f\u8ba8\u8bba \u7a0b\u5e8f\u8bed\u8a00\u7f16\u8bd1\u540e\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u5728\u8fd0\u884c\u65f6\u63d0\u4f9b\u7684\u65b9\u65b9\u9762\u9762\u7684\u529f\u80fd\uff0c\u4f8b\u5982 \u7a0b\u5e8f\u7684\u6808\u5e41 \u8c03\u5ea6\u6a21\u5f0f\uff08\u62a2\u5360 \/\u975e\u62a2\u5360\uff09 \u8c03\u5ea6\u5355\u4f4d \u8c03\u5ea6\u7b56\u7565 \u5185\u5b58\u56de\u6536\u7b56\u7565 \u53d8\u91cf\u7684\u751f\u547d\u5468\u671f \u8bed\u8a00\u5143\u4fe1\u606f\u7684\u53cd\u5c04\u529f\u80fd\uff0c \u8fd9\u90fd\u7b97\u4f5c\u8bed\u8a00\u7684 runtime\uff0c\u6211\u4e0d\u77e5\u9053\u4f60\u6240\u8bf4\u7684 runtime \u662f\u4ec0\u4e48 runtime                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225352\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @qieqie #47 \u53ef\u80fd\u4f60\u6709\u4e00\u4e2a\u66f4\u597d\u7684\u5bf9 runtime \u7684\u89e3\u91ca\uff0c\u613f\u542c\u5176\u8be6\u5427..                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225353\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lewis89 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @byte10 #45 \u53e6\u5916\u540e\u9762\u7684\u7248\u672c\uff0c\u5373\u4f7f\u4f60\u5199\u4e86\u4e2a\u6b7b\u5faa\u73af\uff0c\u73b0\u5728 go \u8c03\u5ea6\u5668\u4e5f\u53ef\u4ee5\u57fa\u4e8e\u4fe1\u53f7\u673a\u5236\u6765\u5b9e\u73b0\u62a2\u5360\u8c03\u5ea6\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5225354\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kksco <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lewis89 \u8001\u54e5\uff0cwx: MTMxNzM2ODAwMTg=                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u51e0\u4e2a\u5173\u4e8e Go Runtime \u7684&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/326261"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=326261"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/326261\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=326261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=326261"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=326261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}