From owner-freebsd-hackers Mon Jul 31 12:21:16 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mta5.rcsntx.swbell.net (mta5.rcsntx.swbell.net [151.164.30.29]) by hub.freebsd.org (Postfix) with ESMTP id 87F7637BBE0 for ; Mon, 31 Jul 2000 12:20:59 -0700 (PDT) (envelope-from chris@holly.calldei.com) Received: from holly.calldei.com ([208.191.149.190]) by mta5.rcsntx.swbell.net (Sun Internet Mail Server sims.3.5.2000.01.05.12.18.p9) with ESMTP id <0FYK008CAT0JPN@mta5.rcsntx.swbell.net> for freebsd-hackers@FreeBSD.ORG; Mon, 31 Jul 2000 14:05:11 -0500 (CDT) Received: (from chris@localhost) by holly.calldei.com (8.9.3/8.9.3) id OAA53166; Mon, 31 Jul 2000 14:03:05 -0500 (CDT envelope-from chris) Date: Mon, 31 Jul 2000 14:03:04 -0500 From: Chris Costello Subject: Re: BSD,Posix,Linux Threading - Are they really useable? In-reply-to: <398534AF.467DE4D5@tornqvist.net> To: Bjorn Tornqvist Cc: Nate Williams , freebsd-hackers@FreeBSD.ORG Reply-To: chris@calldei.com Message-id: <20000731140304.Y37935@holly.calldei.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii User-Agent: Mutt/0.96.4i References: <398111DA.443B41F9@tornqvist.net> <20000728003913.K37935@holly.calldei.com> <200007281538.JAA22915@nomad.yogotech.com> <20000728140854.L37935@holly.calldei.com> <398534AF.467DE4D5@tornqvist.net> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Monday, July 31, 2000, Bjorn Tornqvist wrote: > But how do I know if my pthreads aren't secretely blocking for a very > short time in read() and write()? Documentation anywere? They 'block' for the duration of time it takes to make a non-blocking call to read() or write(), which is, as far as your program cares, practically zero. > > I thought he had seen the term 'kernel threads' in the context > > of FreeBSD before, likely in the context of kthread_create() in > > the kernel. > Actually I have, but I haven't tried them since I found no documentation > on them (I even emailed peter@freebsd.org (he's listed as maintainer in > sys/kthread.h) but got no reply). Just aswell, seeing how wrong I was. > I think I'll stick to pthreads for now; which will make it easier to > modify the code later on when we have ''real'' threads. (Sorry, I come > from a BeOS background). Pthreads is only a specification of an interface, not a form of user threads. We just implement them in the form of user threads. > Another question for you all: Does FreeBSD have any notion of kernel > mutexes and/or semaphores (that can be used to control concurrent > processes), and that can be shared between processes using pthreads? > pthread_mutex_init is local to a process and thus of little use. (FYI: > The application my company is developing consists of several processes, > all of which must have a couple of worker threads). Yes. We do have SysV shared memory support. Try ``man -k ^shm'' and ``man -k ^sem''. -- |Chris Costello |Printed on 100% recyclable phosphor. `------------------------------------ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message