zsim icon indicating copy to clipboard operation
zsim copied to clipboard

avoid sleeping-relted deadlock (Issue #231)

Open jasonzzzzzzz opened this issue 6 years ago • 1 comments

Previous ThreadFini() lacks control of SLEEPING threads in finish(). This change helps many-thread simulation to completion; Otherwise, it deadlocks when running TailBench Apps with only 2-4 threads.

jasonzzzzzzz avatar Nov 15 '19 22:11 jasonzzzzzzz

I think this fix is correct. Please also clean up the print message and debug notes in the code. Also, it seems you do not need to actually schedule it after you remove it from the sleep queue. It is finishing any way. Simply mark it as BLOCKED and leave it to the later code to deal with.

gaomy3832 avatar Dec 09 '19 08:12 gaomy3832