Closed cabelshrestha closed 7 years ago
This wasn't an issue with timer unit of time. The program was deadlocking. This was one of the issues we were having with how scheduler checked for deadlocks. But now it has been fixed.
To detect deadlock, the scheduler checks the following:
if (inactivePool.getCount() == rq.size() && rq.size() > 0 && tq.isEmpty())
When the last timer is removed from the timer queue w/ a tq.take()
and scheduler gets to the detection code before the timer queue sets the process ready to run, it terminates the program due to deadlock.
Modified the timerqueue class to indicate empty queue only after setting a process ready to run if it exists.
can you try running this:
Do you see the output after the timeout? I don’t:
however, I think the timing is correct otherwise though I don’t understand why I don’t see the second set of output cause the generated code looks like:
which seems ok?
matt