Posix threads in RHAT9

Kevin D. Clark kevin_d_clark at access-4-free.com
Wed May 19 22:51:00 EDT 2004


"Michael ODonnell" <michael.odonnell at comcast.net> writes:

> Can anybody offer comments about threading on RHAT9,
> or even about the general state/politics of threading
> in Linux? 

> Can I still build/run a pthreaded app on
> that box?

For my last job I was heavily involved with writing a large daemon
that was heavily multi-threaded.  The original target platform was
Solaris but I was the one who was most responsible for ensuring that
the product also ran on Linux  (it could have run on other platforms
too...).

I've worked with pthreads a lot, for both this project and quite a few
others too.

I encountered very few problems that were specific to any Linux
implementation of pthreads.  I simply wrote my code carefully and
stuck to the pthread API and I encountered no difficulties.  The
*worst* problem that I encountered was in how the daemon handled
writing out its pid file -- I had a single signal-handling thread that
handled all signals, and the fact that LinuxThreads allocated a new
pid for each thread that was created meant that I had to jump through
a few minor hoops.  But I'm sure you'll agree that this is a very
minor problem.

I can envision that there might be minor issues to be dealt with if
you're doing things like thread/CPU affinity or perhaps heavy use of
signals, but, in the general case, pthreads support on Linux is very
good and only getting better.

I hope this helps,

--kevin




More information about the gnhlug-discuss mailing list