Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jul 1999 16:56:24 -0700
From:      "David Schwartz" <davids@webmaster.com>
To:        "Terry Lambert" <tlambert@primenet.com>, "Tani Hosokawa" <unknown@riverstyx.net>
Cc:        <chat@FreeBSD.ORG>
Subject:   RE: Known MMAP() race conditions ... ?
Message-ID:  <000001becfe6$cfd67a40$021d85d1@youwant.to>
In-Reply-To: <199907162345.QAA18013@usr05.primenet.com>

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

> No, my argument was against getting al het up about FreeBSD not
> having kernel threads, or all excited that kernel threads are
> somehow important for performance.

	Agreed. Kernel threads are nice, but they're not vital. And, of course,
kernel threads can cause problems in situations that are fine with
user-space threads implementations, such as creating 1,000 threads.

> > I just thought of another high profile system that uses threads.  MySQL.
> > It's all threaded.  Threads for MySQL are damn cool, 'coz it
> leaves a tiny
> > memory footprint, especially when compared to other similar systems like
> > PostGres that are process oriented.
>
> Yes.  And you'll notice that it runs just fine on FreeBSD.  So I guess
> FreeBSD does have working threads.

	It's at least theoretically vulnerable to disk I/O blocking. Unless it does
this:

> 	fcntl( fd, F_SETFL, O_NONBLOCK);
>
> It will return an "EWOULDBLOCK" on a failed attempt to read or write,
> which could be reattempted later.

	Yes, the question is, is this better than kernel threads? I think the
answer is a pretty clear NO in many cases for many reasons. This requires a
lot more work saving context, for example.

> So does nay other pthreads application that conforms to POSIX 1003.1c.
>
> Any application which doesn't run (e.g. the claims of one thread
> blocking all other threads) is, by definition of POSIX 1003.1c, broken.

	Please, that's not true and I'm pretty sure you know it. 'gethostbyname'
and  NFS reads are good examples. Unless the user-space threads library
wraps all NFS file I/O. Does it? If it does, half my argument goes away. :)

> > So?  My point is, was, and will be, that FreeBSD doesn't
> *currently* have
> > good threading.  I never said that FreeBSD can't *get* good threading.
>
> FreeBSD currently has good threading.

	Agreed. A user-space threads implementation is perfectly fine for a
significant fraction of the real uses of threads. Just not all of them.

	DS



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000001becfe6$cfd67a40$021d85d1>