Leopold Toetsch wrote:
Attached is a test program, showing an implementations for multiple timers. GNU/linux only, but implementing the platform interface (and the sighandler/message queue) shouldn't be too hard.
don't know if it's worth something, but this is how your timer program could look like under Win32.
Thanks for that. So the general structure seems to fit nicely on Win32 too.
I had to comment out the signal(SIGALRM, sig_alarm_handler); line and add a PeekMessage/DispatchMessage routine in the while loop.
We need such a message handling for Win32 anyway. This will still be some work to check the Win message queue and generate Parrot events, but this will proabaly reside inside CHECK_EVENTS().
the rest of the Win32-specific code is in the "platform interface" section.
Yep.
I realize this is really ugly, but Win32 doesn't seem to have support for alarms, so you have to relay on windows messages instead. if someone can come up with a better way to do it, I'm really curious to see it :-)
AFAIK that's the Windows way to do it.
cheers, Aldo
Thanks for your program, leo