USB bulk read & pthreads

Terry Lambert tlambert2 at mindspring.com
Tue May 20 21:45:33 PDT 2003


Julian Elischer wrote:
> On Wed, 21 May 2003, Jay Cornwall wrote:
> > The problem seems to be a result of reading from a USB endpoint file
> > descriptor, which invokes tsleep() within the kernel
> > (/sys/dev/usb/usbdi_util.c:432) while it waits for data to read. This has the
> > effect of blocking the whole process, rather than just the thread which
> > called the read.
> 
> You should load teh "linuxthreads" port
> and link with that..
> 
> under 5.x you will be able to use the native threads (we will have
> several to choose from :-)
> 
> under 4.x (I presume that's what you are using) the threading is all in
> one process and if a device decides to return "data waiting" in select()
> but keeps the reader waiting, it will block the entire process.

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

-- Terry


More information about the freebsd-hackers mailing list