加入线程的目的是什么? [英] What's the purpose of joining threads?

查看:122
本文介绍了加入线程的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有必要吗?目的是什么?我问,因为我注意到它弄乱了我的同步。我有一个名为Sheep and Wolf和Sheep的线程操纵一个全局变量,当我加入它们时,它会扰乱Sheep线程之间的同步。绵羊线程使用类锁。

Is it necessary? What's the purpose? am asking, because I have noticed that it mess up my synchronization. I have one thread called Sheep and Wolf and Sheep manipulates a global variable and when I join them, it messes up the synchronization between the Sheep thread. The sheep threads uses a class lock.

推荐答案

请参阅我对该问题的评论。阅读主题: http://msdn.microsoft.com/en-us /library/system.threading.thread.join.aspx [ ^ ]。



这个API的作用应该比本文档更明显。你如何使用它取决于你。当我试图找出这里可能不清楚的东西时,我的想象力让我失望。也许你必须解释你的目标或问题,你的情景。



-SA
Please see my comment to the question. Read about the topic: http://msdn.microsoft.com/en-us/library/system.threading.thread.join.aspx[^].

What this API does should be more than obvious from this document. How you use it is up to you. My imagination fails me when I try to figure out what could be unclear here. Perhaps you have to explain your goals or concerns, your scenario.

—SA


这篇关于加入线程的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆