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 [EMAIL PROTECTED] (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 <[EMAIL PROTECTED]>
|Printed on 100% recyclable phosphor.
`------------------------------------


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to