Multiple Thread with dependencies

 

Original Articles comes from http://msdn.microsoft.com/en-us/magazine/dd569760.aspx

However, I met problems. threads in parallel enters into dead lock.  My implement is a littile different with this article. I am using while to check threads. But if doing this, this thread will always hold the lock. Any idea? 

Code

check thread satus, and found it is blocked by execute funciton.

Code

Check the code, no doubt that the lock is always held by the execute funciton, thread 6.

It doesn't has chance to release lock before it is waiting the statelock

 

posted @ 2009-11-10 00:40  Pang pang Xiong  阅读(180)  评论(0编辑  收藏  举报