From owner-freebsd-arch Thu Sep 13 16:30:31 2001 Delivered-To: freebsd-arch@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 0DCEC37B403 for ; Thu, 13 Sep 2001 16:30:29 -0700 (PDT) Received: by elvis.mu.org (Postfix, from userid 1192) id EF0C081D05; Thu, 13 Sep 2001 18:30:28 -0500 (CDT) Date: Thu, 13 Sep 2001 18:30:28 -0500 From: Alfred Perlstein To: mike varga Cc: freebsd-arch@freebsd.org Subject: Re: FD_LOCK, pthreads and drivers Message-ID: <20010913183028.P968@elvis.mu.org> References: <010e01c13ca3$6e12b4a0$4a10a8c0@stcla1.sfba.home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <010e01c13ca3$6e12b4a0$4a10a8c0@stcla1.sfba.home.com>; from mike.varga@cavium.com on Thu, Sep 13, 2001 at 03:28:35PM -0700 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 * 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