From owner-freebsd-arch Wed Sep 26 11:57:15 2001 Delivered-To: freebsd-arch@freebsd.org Received: from philotas.hosting.pacbell.net (philotas.hosting.pacbell.net [216.100.99.24]) by hub.freebsd.org (Postfix) with ESMTP id 455F637B413 for ; Wed, 26 Sep 2001 11:57:09 -0700 (PDT) Received: from c1435077a (adsl-64-172-38-74.dsl.snfc21.pacbell.net [64.172.38.74]) by philotas.hosting.pacbell.net id OAA02335; Wed, 26 Sep 2001 14:56:54 -0400 (EDT) [ConcentricHost SMTP Relay 1.7] Message-ID: <007f01c146bb$1f105fc0$4a10a8c0@stcla1.sfba.home.com> Reply-To: "mike varga" From: "mike varga" To: "Daniel Eischen" Cc: References: Subject: Re: FD_LOCK, pthreads and drivers Date: Wed, 26 Sep 2001 11:43:22 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Will the next release of FreeBSD have the FD_LOCKs removed from the default installation? If so, when is that availible? ----- Original Message ----- From: "Daniel Eischen" To: "Alfred Perlstein" Cc: "mike varga" ; Sent: Thursday, September 13, 2001 5:54 PM Subject: Re: FD_LOCK, pthreads and drivers > On Thu, 13 Sep 2001, Alfred Perlstein wrote: > > * mike varga [010913 17:41] wrote: > > > I noticed that while testing the driver I wrote > > > for a crypto device, that only one thread > > > can be executing within the context of > > > my driver at a time. > > > > > > The problem is that the pthreads library > > > replaces the ioctl with another that exclusively > > > locks the file descriptor with calls to FD_LOCK/ > > > FD_UNLOCK. > > This isn't true for -current. I removed automatic locking of > file descriptors many months ago. > > > > Why? > > Indeed, it should be up to the application to provide protection > for I/O operations on the same file descriptor :-) Or at least > the threads library should stay out of the way and let the application > and kernel decide... > > > > I went to extremes to make sure that it > > > would be fully reentrant. > > > The driver/crypto accelerator now suffers > > > from slow performance. > > > > Under the native FreeBSD threading model there is only one > > process context. You'll want to use the linuxthreads port > > to do this. > > You can have multiple I/O requests within libc_r, but they > are all converted to non-blocking requests and the thread > scheduler periodically polls for I/O completion. If your > device driver doesn't support non-blocking operations, then > our threads library isn't going to help you much even in > -current where FD locking is disabled. > > -- > Dan Eischen > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message