> On Tuesday, 6. November 2001 10:57, Duncan Sands wrote:
> > That's not the end of the world, but it is ugly
> > (extra locks, global data, all that) and wouldn't be necessary if probe/
> > ioctl/disconnect worked like open/read-write/close.
>
> Can you explain to me how open/read-write/close are
> protected against races? One Task writing and another one
> closing the device?

Yes, this was unclear.  I was refering to earlier in the message (or
an earlier message) in which I pointed out that having open and close
methods allows you to keep a usage count of how many people
have opened your device.  On a disconnect, you can check if the
device is open; if it not open, then you can free memory etc;
otherwise you can mark that a disconnect occured, and when the
last close occurs, the close method can free memory etc.

This was in contrast with the ioctl you can specify in struct usb_driver:
since there are no open/close methods, you can't keep a count in this
way and that is a pain (see previous discussion for why it is a pain).

How you were to deduce this discussion from the above lines, I don't
know!  You were right to jump on these lines.

All the best,

Duncan.

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to