digitalmars.D - Timer and Event class
- David (3/3) Aug 08 2012 I was in the need for a threaded Timer, so I wrote one:
- Johannes Pfau (11/16) Aug 09 2012 A timer would be cool. It would be nicer (though more complicated to
- David (5/19) Aug 09 2012 You would have to implement the timer completly different, it uses a
I was in the need for a threaded Timer, so I wrote one: https://github.com/Dav1dde/BraLa/blob/master/brala/utils/thread.d Do you think I should make a pull request for phobos inclusion?
Aug 08 2012
Am Thu, 09 Aug 2012 01:06:23 +0200 schrieb David <d dav1d.de>:I was in the need for a threaded Timer, so I wrote one: https://github.com/Dav1dde/BraLa/blob/master/brala/utils/thread.d Do you think I should make a pull request for phobos inclusion?A timer would be cool. It would be nicer (though more complicated to implement) to support multiple timers running in one thread. Mono had And we should probably try to support a generic API for timers (either templates, isTimer!T, etc or classes+interfaces) as EventLoops (libev, libevent, glib, windows sure has some as well) provide more efficient ways to implement timers. As for the event struct: I'm not sure, as a implementation detail it's fine, but as a public API I'm not sure.
Aug 09 2012
Am 09.08.2012 12:06, schrieb Johannes Pfau:Am Thu, 09 Aug 2012 01:06:23 +0200 schrieb David <d dav1d.de>:You would have to implement the timer completly different, it uses a Condition Lock (core.sync.cond) to wait, except you can wait on multiple locks at once and return when one of these is notified.I was in the need for a threaded Timer, so I wrote one: https://github.com/Dav1dde/BraLa/blob/master/brala/utils/thread.d Do you think I should make a pull request for phobos inclusion?A timer would be cool. It would be nicer (though more complicated to implement) to support multiple timers running in one thread. Mono hadAnd we should probably try to support a generic API for timers (either templates, isTimer!T, etc or classes+interfaces) as EventLoops (libev, libevent, glib, windows sure has some as well) provide more efficient ways to implement timers.This is true, but you don't always want/need a Event Loop.
Aug 09 2012