From owner-freebsd-arch Thu Sep 13 17:13: 7 2001 Delivered-To: freebsd-arch@freebsd.org Received: from cleitus.hosting.pacbell.net (cleitus.hosting.pacbell.net [216.100.99.17]) by hub.freebsd.org (Postfix) with ESMTP id 2665A37B41B for ; Thu, 13 Sep 2001 17:13:04 -0700 (PDT) Received: from c1435077a (adsl-64-172-38-74.dsl.snfc21.pacbell.net [64.172.38.74]) by cleitus.hosting.pacbell.net id UAA00517; Thu, 13 Sep 2001 20:13:00 -0400 (EDT) [ConcentricHost SMTP Relay 1.7] Message-ID: <014001c13cb0$36eb5e70$4a10a8c0@stcla1.sfba.home.com> Reply-To: "mike varga" From: "mike varga" To: "Alfred Perlstein" , References: <010e01c13ca3$6e12b4a0$4a10a8c0@stcla1.sfba.home.com> <20010913183028.P968@elvis.mu.org> Subject: Re: FD_LOCK, pthreads and drivers Date: Thu, 13 Sep 2001 17:00:07 -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 Are both of the threading models posix complient? Can I replace one with the other, without affecting the operation of the applications using them? This seems to indicate that it is not a kernel requirement; only someone decided to force locking on the file descriptors regardless of whether they where actually needed. Is this true? ----- Original Message ----- From: "Alfred Perlstein" To: "mike varga" Cc: Sent: Thursday, September 13, 2001 4:30 PM Subject: Re: FD_LOCK, pthreads and drivers > * 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. > > > > Why? > > > > 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. > > -- > -Alfred Perlstein [alfred@freebsd.org] > 'Instead of asking why a piece of software is using "1970s technology," > start asking why software is ignoring 30 years of accumulated wisdom.' > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message