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

Posted Rocinante

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了操作系统OS - 线程中的join()为什么叫join相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

Python threading 中join()的作用

java并行之parallerlStream

Java Thread.join的作用和原理

python37

Java并发和高并发学习总结- J.U.C之工具类

线程中的sleep()join()yield()方法有什么区别?