USB bulk read & pthreads

Jay Cornwall jay at evilrealms.net
Wed May 21 15:45:25 PDT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 21 May 2003 17:23 pm, you wrote:

> > Or it's a bug in the USB driver, not honoring non-blocking I/O.

> ugen(4) does not support non-blocking I/O like most other driver also do
> not.
>
> I don't count it as a bug as noone ever told that it does.
> It's even documented in ugen(4):
>      The bulk transfer mode can be in or out depending on the endpoint.  To
>      perform I/O on a bulk endpoint read(2) and write(2) should be used. 
> All I/O operations on a bulk endpoint are unbuffered.
> non-blocking requires buffered I/O.

Yes, blocking I/O isn't a problem for this application (as it's thread-based). The problem arises from ugen blocking the entire process, rather than just the thread which invoked the blocking read.

This isn't consistent with normal blocking read behaviour AFAIK, and I just wondered if there was a reason it was implemented in this way, or if it was simply an oversight on the use of threading with the ugen device.

But thanks for your comments, all are welcome. :)

Cheers,
Jay

- -- 
http://www.evilrealms.net/ - Systems Administrator & Developer
http://www.ic.ac.uk/ - Imperial College, 2nd year CS student
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+zAFgfJLn3O/2GbERArPzAKCAUyHVaVmN7PK38x3v0LJA5mkiqwCfQdOI
mzY9GtSfHsk6lzXEm1kASsw=
=BAhJ
-----END PGP SIGNATURE-----


More information about the freebsd-hackers mailing list