From owner-freebsd-hackers Thu Jul 27 14:55:12 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 2A9B837C0EA for ; Thu, 27 Jul 2000 14:55:09 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id RAA03681; Thu, 27 Jul 2000 17:54:47 -0400 (EDT) Date: Thu, 27 Jul 2000 17:54:47 -0400 (EDT) From: Daniel Eischen To: Doug White Cc: =?Windows-1252?Q?Nicolas_L=E9onard?= , hackers@FreeBSD.ORG Subject: Re: kevent()/kqueue() in a multithreaded environment In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Transfer-Encoding: QUOTED-PRINTABLE Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 27 Jul 2000, Doug White wrote: > On Wed, 26 Jul 2000, [Windows-1252] Nicolas L=E9onard wrote: >=20 > > I'm trying to use the new kqueue()/kevent() syscalls in the last=20 > > snapshot of FreeBSD 5.0. > > It works perfectly, except when I'm trying to use it in a multi- > > threaded program. > > The call of kevent() by my network thread blocks the other thread. > >=20 > > I look in the libc_r sources and I found that this syscall isn't=20 > > already wrapped. > >=20 > > Does anybody know if there is a patch or another tips to make it=20 > > work ? >=20 > You normally wouldn't mix kqueue and threads; you'd use kqueue to > *implement* threads. :-) Right. This is what we did for poll() -- wrapped it and used it to implement our libc_r threads. We could probably change libc_r's internal use of poll() to kqueue(), but I'm not sure we want to be beating a dead horse when a better threading solution is on the horizon. --=20 Dan Eischen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message