码迷,mamicode.com
首页 > 编程语言 > 详细

操作系统OS - 线程中的join()为什么叫join

时间:2018-04-22 12:51:40      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:主线程   join()   for   完成   tail   ini   tps   arm   href   

1. 问题:很好奇为什么叫Join?

参考:

  1. https://blog.csdn.net/frankarmstrong/article/details/55504161
  2. https://stackoverflow.com/questions/15956231/what-does-this-thread-join-code-mean
  3. https://stackoverflow.com/questions/9366264/what-does-it-mean-to-join-a-thread
  4. https://en.wikipedia.org/wiki/Fork%E2%80%93join_model
  5. http://www.infoq.com/cn/articles/fork-join-introduction

2. 答案:就是一个线程(调用者)等待这个线程(调用了Join方法)的完成(正常或异常)。

2.1 The thread(一般是主线程main thread)calls t1.join() to wait for the t1 thread to finish.
2.2 就像是对t1说, "Come on, Join us!"

操作系统OS - 线程中的join()为什么叫join

标签:主线程   join()   for   完成   tail   ini   tps   arm   href   

原文地址:https://www.cnblogs.com/allen2333/p/8906082.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!