开发者

What is the difference between C# Thread.Sleep() and threadreference.Join()?

开发者 https://www.devze.com 2022-12-13 14:00 出处:网络
What is the difference between C# Thread.Sleep() and threadreference.Jo开发者_如何学JAVAin()?Sleep is a method which suspends a thread for a period of time.It acts on a single thread.

What is the difference between C# Thread.Sleep() and threadreference.Jo开发者_如何学JAVAin()?


Sleep is a method which suspends a thread for a period of time. It acts on a single thread.

Join is a method which suspends a thread until another thread has finished. It can be configured to sleep infinitely until that thread completes or for a finite period of time or until the other thread completes. This is a method for synchronization between multiple threads.


Sleep causes the current thread to sleep for the specified amount of time. Join will wait (block) the current thread until the referenced thread completes.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号