From owner-freebsd-arch Thu Sep 13 15:41:43 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 5666237B410 for ; Thu, 13 Sep 2001 15:41:29 -0700 (PDT) Received: from c1435077a (adsl-64-172-38-74.dsl.snfc21.pacbell.net [64.172.38.74]) by cleitus.hosting.pacbell.net id SAA21723; Thu, 13 Sep 2001 18:41:28 -0400 (EDT) [ConcentricHost SMTP Relay 1.7] Message-ID: <010e01c13ca3$6e12b4a0$4a10a8c0@stcla1.sfba.home.com> Reply-To: "mike varga" From: "mike varga" To: Subject: FD_LOCK, pthreads and drivers Date: Thu, 13 Sep 2001 15:28:35 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_010B_01C13C68.C14A6C70" 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 This is a multi-part message in MIME format. ------=_NextPart_000_010B_01C13C68.C14A6C70 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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=20 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.=20 ------=_NextPart_000_010B_01C13C68.C14A6C70 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I noticed that while testing the driver = I=20 wrote
for a crypto device, that only one=20 thread
can be executing within the context = of
my driver at a time.
 
The problem is that the pthreads = library=20
replaces the ioctl with another that=20 exclusively
locks the file descriptor with calls to FD_LOCK/
FD_UNLOCK.
 
Why?
 
 I went to extremes to make sure = that=20 it
would be fully reentrant.
The driver/crypto accelerator now=20 suffers
from slow performance.=20
------=_NextPart_000_010B_01C13C68.C14A6C70-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message