[patch] asynchronous callouts

David Zeuthen david at fubar.dk
Wed Apr 21 02:46:25 PDT 2004


On Tue, Apr 20, 2004 at 04:50:37PM -0400, Joe Shaw wrote:
> >  3. Calling waitpid during idletime may not be a good idea; I'd guess
> >     it would hog the CPU? Why don't we just listen for SIGCHILD?
> 
> I remember now why I didn't do this originally: it's an incredible pain
> in the ass. :)  The only safe way to do it is to set up a pipe and have
> the SIGCHLD handler write to it and have the other end attached to the
> main loop via g_io_watch_add(), since we could be interrupting anything
> and breaking stuff.  

Ok, yeah, it's probably safest this way. I'm not sure though it's *really*
required as one of the preconditions is that the device is still in the
TDL and as such no one will know about it and thus not interact with it. 

Anyway, we should probably do it the way you described, it sounds a lot
safer. You can possibly build on top of the async_spawn_helper stuff I
sent yesterday.

> Unfortunately, glib 2.4 has exactly what we want
> for this. :)  

I'm not keen on depending on glib 2.4 for this; for instance glib 2.4 is
not in debian unstable yet, but hal is.

> I can take a look at it a little more tomorrow (I have to
> go soon), 

Very nice. I want to make a new release sometime this week (in fact the
versions numbers in CVS are already bumped to 0.2.90), so it would be
nice to finish this.

Cheers,
David





_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list