Would it make any sense to resurrect my old suggestion/idea
of using round-robin USB device numbers instead of
always assigning the lowest number available or is it
considered bad?  It could cause some user confusion also.

Actually I think I like the _concept_ that you are suggesting,
Johannes.  Sounds like a way to keep using low-numbered device
IDs unless they shouldn't be reused.  I'm not so hot
on depending on an application to do this, though.
I'd prefer to see another solution that has the same effect,
but I'm struggling with how to do that.

I'm just thinking aloud (so to speak)...maybe have dual
modes of device number assignment, default is LOWEST_AVAIL.
On disconnects, set mode to ROUND_ROBIN.
This applies to the next connect.  After this next
connect, set mode back to LOWEST_AVAIL.
Sounds like a kludge, right?  And all that it does
is reduce the window size for the race condition,
not eliminate it.  Using round robin all the time
is the extreme case of minimizing the window size,
especially since it's not real likely that someone
will actually have 127 devices.

~Randy
___________________________________________________
|Randy Dunlap     Intel Corp., DAL    Sr. SW Engr.|
|randy.dunlap.at.intel.com            503-696-2055|
|NOTE:  Any views presented here are mine alone   |
|and may not represent the views of my employer.  |
|_________________________________________________|

> > 2) Gives you atomicity problems.
> >    Assume a program needs two endpoints, it opens the first,
> >    then sleeps for whatever reason, in the mean time the
> >    device gets unplugged and a new device plugged in which
> >    gets the same device number, then the program wakes up
> >    and opens the second ep, which will now be an ep of
> >    the new device.
> > 
> >    Granted, this race is very small, but nevertheless
> >    there 8-)
> 
> How about requiring an application to have one node open at 
> all times it
> intends to use it. Then, if a device node is still open, it 
> won't reassign
> that usb id to a new device?
> 
> Perhaps it can be a main device node (the node which returns
> descriptors) or something similar.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to