From owner-freebsd-hackers@FreeBSD.ORG Tue May 20 16:40:18 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D251E37B401 for ; Tue, 20 May 2003 16:40:18 -0700 (PDT) Received: from sccrmhc03.attbi.com (sccrmhc03.attbi.com [204.127.202.63]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2164643FA3 for ; Tue, 20 May 2003 16:40:18 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by attbi.com (sccrmhc03) with ESMTP id <200305202340170030095eu3e>; Tue, 20 May 2003 23:40:17 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA67020; Tue, 20 May 2003 16:40:15 -0700 (PDT) Date: Tue, 20 May 2003 16:40:14 -0700 (PDT) From: Julian Elischer To: Jay Cornwall In-Reply-To: <200305210013.09834.jay@evilrealms.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: USB bulk read & pthreads X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2003 23:40:19 -0000 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. On Wed, 21 May 2003, Jay Cornwall wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi > > I've been trying (unsuccessfully) to make the thread-based pppoa3 program > (from http://speedtouch.sf.net/) able to work correctly under FreeBSD. Near > identical code works fine under Linux, but the threading doesn't work at all > in FreeBSD. > > 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. > > I'm sure there are good reasons for implementing it in this way, but I'd be > interested to hear what they are, and if any alternative approaches had > been/are being considered. > > Forgive my lack of knowledge with the FreeBSD kernel, I've only been using it > for a couple of weeks. :( > > 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+yraFfJLn3O/2GbERAsFGAJ947XIElRiR0sz7U7O1nq73N0ccMACcD0bT > fWLxgfMSx9n4/1ktz+kOclU= > =1SjD > -----END PGP SIGNATURE----- > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >