From owner-freebsd-hackers Fri Jul 28 21:42:46 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by hub.freebsd.org (Postfix) with ESMTP id 3644D37B81B for ; Fri, 28 Jul 2000 21:42:39 -0700 (PDT) (envelope-from nate@yogotech.com) Received: from nomad.yogotech.com (nomad.yogotech.com [206.127.123.131]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id WAA16757; Fri, 28 Jul 2000 22:42:35 -0600 (MDT) (envelope-from nate@nomad.yogotech.com) Received: (from nate@localhost) by nomad.yogotech.com (8.8.8/8.8.8) id WAA25461; Fri, 28 Jul 2000 22:42:27 -0600 (MDT) (envelope-from nate) Date: Fri, 28 Jul 2000 22:42:27 -0600 (MDT) Message-Id: <200007290442.WAA25461@nomad.yogotech.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Archie Cobbs Cc: Doug White , hackers@FreeBSD.ORG Subject: Re: kevent()/kqueue() in a multithreaded environment In-Reply-To: <200007281945.MAA26198@bubba.whistle.com> References: <200007281945.MAA26198@bubba.whistle.com> X-Mailer: VM 6.34 under 19.16 "Lille" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > You normally wouldn't mix kqueue and threads; you'd use kqueue to > > *implement* threads. :-) > > > > AFAIK kqueue hasn't been made threadsafe, you'll have to bug > > jlemon@freebsd.org about it. Patches gladly accepted :) > > I may be just being stupid but I don't understand that last sentence. > > I thought kqueue() and kevent() were system calls... how can they > not be thread safe? I think there is a mis-communication here. They are thread 'safe', but if called, they block out all other 'threads' from running, so using kqueue doesn't allow for multiple threads to run 'concurrently'. In other words, a wrapper needs to be written so it can work in a 'threaded' environment effeciently. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message