
On Tue, Jan 01, 2008 at 08:23:42PM -0500, David Roundy wrote:
On Dec 30, 2007 5:28 PM, Andrea Rossato
wrote: On Sun, Dec 30, 2007 at 04:57:47PM -0500, David Roundy wrote:
We could fork a process that waits one second and then uses XSendEvent() to send a message to the other, and then exits. This seems reasonably elegant. It avoids the need for an external binary, it's moderately efficient (probably more so than execing a new binary), and we could even encapsulate it in a simple function.
The problem is that the forked thread will be blocked too as long as the main thread is blocked by XNextEvent.
But I didn't suggest to fork a thread, but rather a process. And that's something that ghc's stupidity can't affect. It's somewhat inefficient, but more elegant (and more efficient) than shipping extra binaries.
sorry David, my fault: I didn't understand at first. This approach seems interesting to me and I'll investigate which Event we could send to have this timer. Thanks, Andrea