Is there any mechanism to queue events at a given priority?

What I have is, more or less, the following. I have a Daemon which listens on several 
UDP sockets. Messages tend to arrive in bursts and need to be served quickly. I also 
have a database connection on a TCP socket which I must monitor. When a message 
arrives on the UDP socket I need to quickly generate a response AND queue some jobs to 
be done, but only after processing all the UDP messages. This jobs are of two types, 
one has more priority than the TCP connection, and the other has less priority ( and 
also causes activity to be initiated on the TCP sockets ).

What I'd like to do is have a high priority(2), watcher for the UDP socket, a 
normal(4) one for the TCP, and somehow generate events at priorities (3) and (5) to do 
the generated jobs. ¿ is there some easy way to do this ?

Francisco Olarte Sanz.



Reply via email to