From owner-freebsd-hackers@FreeBSD.ORG Tue May 20 16:13:09 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 5AD9E37B401 for ; Tue, 20 May 2003 16:13:09 -0700 (PDT) Received: from viper.evilrealms.net (evilrealms.demon.co.uk [62.49.12.231]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD53643F3F for ; Tue, 20 May 2003 16:13:07 -0700 (PDT) (envelope-from jay@viper.evilrealms.net) Received: from viper.evilrealms.net (jay@localhost [127.0.0.1]) by viper.evilrealms.net (8.12.8/8.12.8) with ESMTP id h4KNDAFi007346 for ; Wed, 21 May 2003 00:13:10 +0100 Received: from localhost (localhost [[UNIX: localhost]]) by viper.evilrealms.net (8.12.8/8.12.8/Submit) id h4KNDAE6007345 for freebsd-hackers@freebsd.org; Wed, 21 May 2003 00:13:10 +0100 From: Jay Cornwall To: freebsd-hackers@freebsd.org Date: Wed, 21 May 2003 00:13:07 +0100 User-Agent: KMail/1.5.1 MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200305210013.09834.jay@evilrealms.net> Subject: 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:13:09 -0000 =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi I've been trying (unsuccessfully) to make the thread-based pppoa3 program=20 (from http://speedtouch.sf.net/) able to work correctly under FreeBSD. Near= =20 identical code works fine under Linux, but the threading doesn't work at al= l=20 in FreeBSD. The problem seems to be a result of reading from a USB endpoint file=20 descriptor, which invokes tsleep() within the kernel=20 (/sys/dev/usb/usbdi_util.c:432) while it waits for data to read. This has t= he=20 effect of blocking the whole process, rather than just the thread which=20 called the read. I'm sure there are good reasons for implementing it in this way, but I'd be= =20 interested to hear what they are, and if any alternative approaches had=20 been/are being considered. =46orgive my lack of knowledge with the FreeBSD kernel, I've only been usin= g it=20 for a couple of weeks. :( Cheers, Jay =2D --=20 http://www.evilrealms.net/ - Systems Administrator & Developer http://www.ic.ac.uk/ - Imperial College, 2nd year CS student =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+yraFfJLn3O/2GbERAsFGAJ947XIElRiR0sz7U7O1nq73N0ccMACcD0bT fWLxgfMSx9n4/1ktz+kOclU=3D =3D1SjD =2D----END PGP SIGNATURE-----