{"id":296982,"date":"2021-01-18T03:23:18","date_gmt":"2021-01-17T19:23:18","guid":{"rendered":"http:\/\/4563.org\/?p=296982"},"modified":"2021-01-18T03:23:18","modified_gmt":"2021-01-17T19:23:18","slug":"golang-waitgroup-%e5%8e%9f%e7%90%86%e6%b7%b1%e5%ba%a6%e5%89%96%e6%9e%90","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=296982","title":{"rendered":"Golang WaitGroup \u539f\u7406\u6df1\u5ea6\u5256\u6790"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Golang WaitGroup \u539f\u7406\u6df1\u5ea6\u5256\u6790               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cyhone <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p><code>sync.WaitGroup<\/code> \u662f Golang \u4e2d\u5e38\u7528\u7684\u5e76\u53d1\u63aa\u65bd\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u5b83\u6765\u7b49\u5f85\u4e00\u6279 Goroutine \u7ed3\u675f\u3002<\/p>\n<p>WaitGroup \u7684\u6e90\u7801\u4e5f\u975e\u5e38\u7b80\u77ed\uff0c\u629b\u53bb\u6ce8\u91ca\u5916\u4e5f\u5c31 100 \u884c\u5de6\u53f3\u7684\u4ee3\u7801\u3002\u4f46\u5373\u4f7f\u662f\u8fd9 100 \u884c\u4ee3\u7801\uff0c\u91cc\u9762\u4e5f\u6709\u7740\u5173\u4e4e\u5185\u5b58\u4f18\u5316\u3001\u5e76\u53d1\u5b89\u5168\u8003\u8651\u7b49\u5404\u79cd\u6027\u80fd\u4f18\u5316\u624b\u6bb5\u3002<\/p>\n<p>\u672c\u6587\u5c06\u57fa\u4e8e go-1.13 \u7684\u6e90\u7801 \u8fdb\u884c\u5206\u6790\uff0c\u5c06\u4f1a\u6d89\u53ca\u4ee5\u4e0b\u77e5\u8bc6\u70b9:<\/p>\n<ol>\n<li>WaitGroup \u7684\u5b9e\u73b0\u903b\u8f91<\/li>\n<li>WaitGroup \u7684\u5e95\u5c42\u5185\u5b58\u7ed3\u6784\u53ca\u6027\u80fd\u4f18\u5316<\/li>\n<li>WaitGroup \u7684\u5185\u90e8\u5982\u4f55\u5b9e\u73b0\u65e0\u9501\u64cd\u4f5c<\/li>\n<\/ol>\n<p>\u70b9\u51fb\u67e5\u770b\u5168\u6587<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>2<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4994451\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : cyhone <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u539f\u6587\u94fe\u63a5\uff1a https:\/\/www.cyhone.com\/articles\/golang-waitgroup\/<br \/>\u6b22\u8fce\u5173\u6ce8\u516c\u4f17\u53f7\uff1a\u7f16\u7a0b\u6c89\u601d\u5f55                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4994452\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dalaomai <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u8c22\u4f5c\u8005                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Golang WaitGroup &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\/296982"}],"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=296982"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/296982\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296982"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}