[patch] asynchronous callouts

Joe Shaw joe at ximian.com
Fri Apr 23 12:20:39 PDT 2004


On Thu, 2004-04-22 at 23:53 +0200, David Zeuthen wrote:
> On Thu, 2004-04-22 at 23:41, Joe Shaw wrote:
> > On Tue, 2004-04-20 at 22:45 +0200, David Zeuthen wrote:
> > > Ok - thinking a bit more about it, we should probably callout right
> > > after merging from .fdi files..
> > > 
> > > That is, just before adding to the GDL but after the device is named. 
> > > 
> > > This means our D-BUS access functions also must search the TDL
> > > (temporary device list), but this should be an easy fix.
> > 
> > Ok, I've started on this.
> 
> Very nice.

Ugh.  This is all becoming very messy because so much more stuff is
becoming asynchronous.

I'm going to simplify the example to just the bus devices, since that's
what I ran into first.

The way it is now:

        1. bus_device_visit() is called for all of the bus devices
        immediately.
        
        2. An async call to bus_device_got_parent() is set up, once the
        parent is set.  But because we're probing initially and things
        are examined in order, this is a synchronous call.
        
        3. bus_device_got_parent() generated a permanent UDI and adds
        the device to the GDL.
        
        4. The callouts are queued up in hal_callout_device().
        
        5. The callouts are called in a loop as a part of the main loop;
        properties are added well after the device is in the GDL.
        
I have to change this basically to call the callouts in
bus_device_got_parent() instead of adding it to the GDL, and then
listening for a signal for when the callouts for a device are done and
then add the device to the GDL.

This means that we'll have to get rid of the "is_probing" special case,
since the devices won't be immediately and synchronously added to the
GDL in order.  They'll have to be added as their callouts are completed.

The problem I am seeing now is a firehose effect.  Basically all of the
async calls to bus_device_got_parent() are now timing out at the same
time, and the parent/child relationships aren't getting set up.

So I am a little stuck right now.  Did I do a decent job of explaining
this?  Any suggestions?

Joe


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



More information about the Hal mailing list