in reply to multiple infinitive loops
Threading is the obvious solution -- we'll help you if you show us what you tried -- but there might be alternatives. What kind of events are these?
Are they filehandles? Look at select() or its OO counterpart IO::Select. This only works on sockets in Windows, but there's a workaround to produce selectable pipes.
Are you on Windows? If these are Windows events or could be wrapped by a Windows event, you could access WaitForMultipleEvents via some Win32 module.
Can you specify a timeout? If so, you could use:
while(1) { Sub1(TIMEOUT); Sub2(TIMEOUT); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: multiple infinitive loops
by ozkaa (Acolyte) on Oct 06, 2004 at 16:34 UTC | |
by ikegami (Patriarch) on Oct 06, 2004 at 17:03 UTC | |
by ozkaa (Acolyte) on Oct 06, 2004 at 17:10 UTC | |
by ikegami (Patriarch) on Oct 06, 2004 at 17:19 UTC | |
by melora (Scribe) on Oct 06, 2004 at 16:52 UTC |