Re: function call when event loop is idle?

Paul Law writes:

> Does anyone know of a simple way to destinate a function (implemented 
> by the client application) to be called when the event loop is idle? 
> For example, the client might want to do some housekeeping tasks 
> and/or fetch some documents from the net (not initiated by the user 
> or the result of previous fetches) when the event loop has no 
> outstanding user event or active socket.

On Unix, you can register a timeout callback function to be called when 
select() times out. You can register the function to be called always - that 
is - both when loads are going on and when the Library is idle, or you can 
register it only to be called when the Library is waiting for a request. 
Unfortunately you can only register one timeout function as select() doesn't 
support more than this.

On Windows, it uses SetTimer() and I am not sure about if the functionality 
matches - Eric?

> In case it does matter, I work on Windows NT platform.

It shouldn't but who knows ;-?


Henrik Frystyk Nielsen, <frystyk@w3.org>
World-Wide Web Consortium, MIT/LCS NE43-356
545 Technology Square, Cambridge MA 02139, USA

Follow-Ups: References: