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?