[patch] asynchronous callouts
David Zeuthen
david at fubar.dk
Sun Apr 25 11:04:04 PDT 2004
On Sun, 2004-04-25 at 19:58, Joe Shaw wrote:
> On Sun, 2004-04-25 at 19:39 +0200, David Zeuthen wrote:
> > So the changes I suppose that needs to be done are the following:
> >
> > 1. Remove callouts from gdl_store_changed
> >
> > 2. All the places we do a hal_device_store_add to the gdl needs
> > to be replaced with the initiation of the callouts. When the
> > callouts complete a callback should be called to add the device
> > to the gdl.
> > The call would look like much the same way as e.g. the function
> > hal_device_store_match_key_value_string_async.
>
> Right, these are things I've already done. It doesn't really address
> the problem, though, that all of the devices are added at once and
> basically all timeout at once.
But the patch I just committed changes this - the timeout is now always
30 seconds at startup - except when visiting a toplevel device e.g.
/sys/devices/pci0000:00/0000:00:07.1
then we don't bother searching for a parent. So this is immediately
added to the GDL. At some point we visit this device
/sys/devices/pci0000:00/0000:00:07.1/ide0
and this waits (up until 30 seconds) until the device with the sysfs
path /sys/devices/pci0000:00/0000:00:07.1 is in the GDL. So this works.
The proposal is to delay adding /sys/devices/pci0000:00/0000:00:07.1 to
the GDL until after callouts complete - this might take five seconds,
but when it's done the got_parent is called for
/sys/devices/pci0000:00/0000:00:07.1/ide0. And the it works.
Or have I missed something?
David
_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal
More information about the Hal
mailing list