幽夜逸光
2021-04-17
没理解,既然已经有了join,子线程的生命周期肯定小于主线程了啊。
共 1 条评论
2
ilookers
2021-02-26
这个例子有一些疑惑想请教张老师,主线程中 duration 的所有权先 move 到 Sub thread 1,在 Sub thread 1 执行的过程中,又将 duration 的所有权 move 到 Sub thread 2 中,而后在 Sub thread 1 的最后一行 thread::sleep(duration) 中使用了 duration。 疑惑点:duration 转移到了 Sub thread 2,在 Sub thread 1 中还能使用,这是什么原因呢?
共 1 条评论
1
JungWoo.
2021-04-24
通过课程实现的一个例子:https://github.com/Choi-Jungwoo/demon
Bruce
2021-04-06
这里的join不能保证子线程先退出吗