On Tuesday 03 June 2008 18:47, Mike Frysinger wrote:
> > > Would this be all it takes? Anyone with more than half an hour's
> > > experience of looking at udev's source code willing to comment? :)
> >
> > Didn't look at udev yet.
> >
> > What about just storing current seq # in a file, and if you see wrong
> > number in that file, just want for correct one to appear (or time out
> > in "reasonable time")?
> 
> how do you time out without running as a daemon?  have the mdev binary 
> sleep()?

More or less. mdev can have an option where to store seqfile:
mdev -l <SEQFILE>, and then it does:

seqnum = atoi(getenv("SEQNUM"));
timeout = 300/2 + 1; /* 3 seconds */
while (--timeout && read_num(SEQFILE) + 1 != seqnum)
        usleep(20*1000);
<do normal mdev stuff>
write_num(SEQFILE, seqnum); /* atomically */

In other words, mdev's will be started asyncronously but will wait
until they see that mdev with preceding seqnum have finished.

> then you may have multiple mdev's sleeping which means you need to  
> do process management, or implement some method for shared communication, 
> or ...

Above looks like pretty simple shared communication to me.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to