Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Dec 1999 17:11:30 -0600
From:      "Richard Seaman, Jr." <dick@tar.com>
To:        "Ronald F. Guilmette" <rfg@monkeys.com>
Cc:        hackers@FreeBSD.ORG
Subject:   FreeBSD Threads (was Re: Practical limit for number of TCP connections?)
Message-ID:  <19991219171130.A338@tar.com>
In-Reply-To: <48572.945643766@monkeys.com>; from rfg@monkeys.com on Sun, Dec 19, 1999 at 02:49:26PM -0800
References:  <19991219160645.E317@tar.com> <48572.945643766@monkeys.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 19, 1999 at 02:49:26PM -0800, Ronald F. Guilmette wrote:

> I dunno if it goes without saying or not, but this certainly makes
> the current FreeBSD threads implementation highly unpalatable, except
> to support ported code which has been developed elsewhere and which
> is already written to assume the presence/availability of thread
> library primitives.

I wouldn't go that far.  The current implementation is not nearly
as good as it could be, but it works nicely for some reasonable
range of applications.

> Certainly, if I were starting out to write a brand new new multi-threaded
> application program specifically for execution on FreeBSD _today_, I'd
> either (a) wait for the new thread implementation to be ready or else
> (b) not use threads at all.

If user threads don't work for you, then the linuxthreads port
(uses kernel threads) might.  Its a POSIX style pthreads implementation,
so when FreeBSD does "kernel threads", or the equivalent, if should
be as easy (cross your fingers) as recompiling and relinking
to a different library.

> (Actually, I guess there is a third option,
> i.e. writing my code to use the existing threads API, and then just hoping
> that the new threads implementation shows up before I was done coding my
> application.)

Or code your application and use either user threads or
linux (kernel) threads until the new threads library is available.
Unless I misunderstand, all three (user, linux, and the "new")
will (do) use POSIX pthread API's.  Migration shouldn't be very
hard.  The new version might have more functionality, so you
might need to recode slightly to take advantage of the wider
range of options (eg. mixing PTHREAD_SCOPE_SYSTEM threads
with PTHREAD_SCOPE_PROCESS threads), but only if you need the
added functionality.

-- 
Richard Seaman, Jr.           email: dick@tar.com
5182 N. Maple Lane            phone: 262-367-5450
Chenequa WI 53058             fax:   262-367-5852


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?19991219171130.A338>