Time Events: How to handle multiple pending time events within a single thread on UNIX type systems?

Time Events: How to handle multiple pending time events within a single thread on UNIX type systems?

Post by John Sotac » Fri, 16 Mar 2001 04:54:16



I have a thread that responds to messages from a message queue.  Its an
endless loop that does a blocking message recieve, processes the message and
then waits for the next message.  I would like to be able to set up multiple
"time" events, so that for each, a unique message is placed in the queue at
the designated time.  For example, I might want a TIME1 message to be sent
in 10 seconds from now and a TIME2 message to be sent 20 seconds from now.
Thus both events would be pending at the same time.

I realize I can do this by writing special code.  Is there an existing UNIX
means of having multiple pending time events for a single task?  Can I
specify a unique signal to be sent at a specific time.  Can I cause multiple
functions to be called at different times?

John

 
 
 

1. Joystick -->Create an event --> Handle this event

I would like to learn how can an event be generated on JOYSTICK move and/or
JOYSTICK button pressed ?
And how an event handler can be called to perform a say Beep when JOYSTICK
moved or clicked?

Is there any C++(or C) code samples to show JOYSTICK and event handling ?

Thanks..

2. Bill Gates Is A Baby-Eater

3. Console Graphics and Timing Events and Real Time programming

4. Idiot has problem at step zero

5. IEE Event: Designing Embedded Real-Time Systems

6. wtmp and xdm

7. Glade Programming, Handling system event sounds.

8. Solaris 7 Install Trouble - Please Help

9. timing an event

10. How get the time of ANY keyboard-event?

11. ssh problem - bad time limit in the event loop

12. How to measure time between two events ?

13. Time-based events screwed up in X (not reliable)