[转]并行任务,线程池,工作窃取算法
记得在上个月,微博上有一则热议的新闻:小学数学老师布置作业,要求“数一亿粒米” 网友大多数是以吐槽的态度去看待这件事,也有人指出能用估算的方法,这是一道考察发散思维的题目。 一开始我也觉得这个题目很荒唐,似乎是不可能完成的任务。但这个细细想来值得玩味,我在思考一个问题:如果从计算机的角度去看,如何才能最快速地数一亿粒米呢?
Just One Pure ITer
记得在上个月,微博上有一则热议的新闻:小学数学老师布置作业,要求“数一亿粒米” 网友大多数是以吐槽的态度去看待这件事,也有人指出能用估算的方法,这是一道考察发散思维的题目。 一开始我也觉得这个题目很荒唐,似乎是不可能完成的任务。但这个细细想来值得玩味,我在思考一个问题:如果从计算机的角度去看,如何才能最快速地数一亿粒米呢?
Follow:
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |