LinuxThreads replacement

Petri Helenius pete at he.iki.fi
Tue Jul 15 01:32:26 PDT 2003


>
> One evil purpose threads can be used for is to intentionally exploit
> a decriptor close race with a blocking fd operation not protected by
> giant, such that the close invalidates the descriptor before the
> blocking operation completes, after which the code following the
> blocking operation dereferences the (now invalid) descriptor contents.
>
Are you saying that this is a fundamental flaw in the design or a bug
that hasn´t been fixed as of yet?
>
> I can also guarantee you from a performance perspective that an FSA
> will beat almost anything else you could write, in terms of raw
> ability to move data, or support high client loads, and will handily
> beat threads, unless you are on an SMP system, and aren't willing to
> run multiple copies of the program to do your scaling.
>
The usual thing I run across is to how effectively manage large
fd_set´s without using threaded architechture. Spinning through a few
thousand descriptors for almost each read gets expensive quickly.
(or write, if you´re going that way)
As usual, suggestions are welcome and might lead to more better
code in the world...

> Yes, this is somewhat mitigated by the fact that it's easier to write
> threads code than an FSA, such that a lesser coder is still able to
> be productive.  As a class, it's a tool I would lump in with things
> like "perl".
>
perl is good "Leatherman(TM)" tool.

> All that said, FreeBSD's libkse is much less offensive, in terms of
> overhead and cost, than a raw 1:1 implementation, like the one in
> the current Solaris, or Linux.  Solaris' argument is that it's hard
> to get something like that correct, and they were worried about the
> implementation bugs; that just adds fodder to the argument that you
> should avoid threaded code, where possible.
>
There are people who solve their database performance problems by
adding memory until everything is cached. Putting more hardware in
seems to be default operating pattern for Solaris environments. And
everybody seems to be happy with it. At least there the OS does not
bloat constantly like it does in the WinTel land.

Pete



More information about the freebsd-threads mailing list