Author serhiy.storchaka
Recipients pitrou, serhiy.storchaka
Date 2013-01-06.18:10:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <201301062010.12041.storchaka@gmail.com>
In-reply-to <1357474336.79.0.841540448608.issue16843@psf.upfronthosting.co.za>
Content
> I don't understand what you're gaining with this complicated class: your
> class guarantees that the sleepers will be woken up, but it doesn't
> guarantee that any user code will actually run.

It guarantees that advance() returns only when all sleepers are sleeping or 
died, and all user code before specified time mark have executed. User code 
running does not take time, only sleeps take time. Actually this class is a 
forward-running time-machine with pause. But it looks overkill here.

> Perhaps the whole thing would be simpler if your tests used a Queue
> instead of a list?

Hmm, I had not occurred to this idea. Indeed, the patch is a little 
complicated (honestly speaking, it is a lot complicated). Here is a more 
simplified patch that uses a queue for synchronization in one direction and 
simple custom timer for synchronization in another direction. Thank you for 
suggestion.
Files
File name Uploaded
test_sched_queue.patch serhiy.storchaka, 2013-01-06.18:10:43
History
Date User Action Args
2013-01-06 18:10:44serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou
2013-01-06 18:10:44serhiy.storchakalinkissue16843 messages
2013-01-06 18:10:44serhiy.storchakacreate