Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Dec 1998 19:29:17 -0500 (EST)
From:      Alfred Perlstein <bright@hotjobs.com>
To:        Kelly Yancey <kbyanc@freedomnet.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   (where are linux threads?) Re: pthreads question/problem...
Message-ID:  <Pine.BSF.4.05.9812281915110.2148-100000@bright.fx.genx.net>
In-Reply-To: <36881978.CFE748CD@freedomnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help

can someone join in and tell us both where the interfaces to the new linux
threads are hidden in freebsd?

i thought it was "options COMPAT_LINUX_THREADS" in my kernel file
and -DCOMPAT_LINUX_THREADS in /etc/make.conf but i can't find it.

is it default now?  where are the functions to interface with them
natively?

thanks.

Kelly, you should read on though about the issue of kernel threads.

On Mon, 28 Dec 1998, Kelly Yancey wrote:

> > wasn't a simple question, pthreads aren't exactly always intuative.
> > 
> > you may want to get O'rielly's(sp?) book on pthreads, although i'm unsure
> > about how detailed it is, or perhaps try to locate the POSIX spec.
> 
>   I think I looked at O'Reilly's book (I've looked at a few now). Oddly,
> I seem to recall it being somewhat useless. Perhaps I'm thinking of one
> of the other books...I'll have to go double check...O'Reilly typically
> produces good books. I'de love to get my hands on the Posix spec, but I
> was under the impression that since it is being produced via ISO that it
> costs $$$ to get the spec (would seem kind of contradictory to the point
> of publishing a spec though, wouldn't it? :) )

It must cost as when thread topics last came up several people "had" the
spec, others didn't, so i assume it's not freely available.

> > one more thing, a dirty secret in FreeBSD is that all threads are done as
> > ONE process, if you have multiple CPUs you do not gain the advantage of
> > multiple processors, you have to design a hybrid fork/thread model.
> > 
> 
>   Argh. Is this going to be fixed in 3.0? Does anyone intend on fixing
> it? I mean, even Linux has kernel support for threads, I should think
> that FreeBSD...the king of server OS'es...could at least do the same.
> For the time being this isn't a problem, as I only have a single CPU,
> but I'm really going to need FreeBSD to support scheduling threads on
> separate processors by the time I finish the project. I *really* like
> FreeBSD, but if I have to I suppose Linux will be the target platform if
> 3.0 can't schedule threads independantly.

Your complaint about 1-1 threads is valid in a sort of sense, however it's
been discussed to death here and on -current.  The general concensus is
that 1-1 threads suck, the informed concensus is that you don't thread for
processor intensive work, only for IO intensive work, threading across SMP
destroys/thrashes cache benefits, your best bet is to use the hybrid
thread/processor mechanism, it's not easy, but it's faster.

depends on how dirty you want your hands to get. :)

also if someone speaks up about the "linux threads" you can probably use
that, although i'm unsure if the userland stuff is in place to actually
use it at this point.

-Alfred

> 
>   You've been a great help,
> 
>   Kelly
> 
> -- 
> Kelly Yancey                "Bill Gates is only a white Persian cat and
> ~kbyanc@freedomnet.com~      a monocle away from being the villain in a
>                              James Bond movie" - comedian Dennis Miller
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9812281915110.2148-100000>