From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 9 15:51:38 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4ECC016A4CE; Wed, 9 Feb 2005 15:51:38 +0000 (GMT) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.13.1/8.13.1) with ESMTP id j19Fpb8R096389; Wed, 9 Feb 2005 10:51:37 -0500 (EST) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.13.1/8.13.1/Submit) id j19FparC096388; Wed, 9 Feb 2005 10:51:36 -0500 (EST) (envelope-from green) Date: Wed, 9 Feb 2005 10:51:36 -0500 From: Brian Fundakowski Feldman To: Dmitry Agaphonov Message-ID: <20050209155136.GC65523@green.homeunix.org> References: <20050209173625.29d50ffd.rzhe@agava.com> <20050209144924.GB65523@green.homeunix.org> <20050209183952.30f4c5b6.rzhe@agava.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050209183952.30f4c5b6.rzhe@agava.com> User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org Subject: Re: kqueue & pthread X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Feb 2005 15:51:38 -0000 On Wed, Feb 09, 2005 at 06:39:52PM +0300, Dmitry Agaphonov wrote: > On Wed, 9 Feb 2005 09:49:24 -0500 > Brian Fundakowski Feldman wrote: > > BFF> Since you're using user threads, not kernel threads, the kernel can only > BFF> have one "object" (poll or select list, or kqueue file descriptor) to wait > BFF> upon at any given time. Since kqueues are pollable, what happens is > BFF> that the kqueue along with every other fd being polled/selected are all > BFF> polled by a single poll(2) system call. Yes, your kqueue is being used, > BFF> but it has an indirection of another poll(2) system call determining > BFF> when your kevent(2) thread should be woken up. > > Brian, thank a lot for your explanation! > > So, pthreads since they are user threads do not provide concurrency on > multiprocessor systems? Right, the libc_r implementation specifically. > And by the way, are there another ways to have kernel threads in FreeBSD 4.x > applications, rather than use LinuxThreads port or implement it via rfork'ed > processes? The LinuxThreads library seems to be the best-supported way. I don't think that there should be legal/licensing issues using it. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\