[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: thread support?

> On Thu, 2 Oct 1997, Chris R. Martin wrote:
>  : I have heard a lot of confusing things about thread support lately. I am
>  : writing a program which will eventually have seperate threads and if anyone
>  : could clear some things up for me, I would really appreciate it!
>  : 
>  : Does a "stock" Debian 1.3.1 install support threads? If not, what packages
>  : or libraries do I need to obtain?
> It doesn't.
> You need the pthreads package, which *is* available in 1.3.1-stable, but not
> selected by default.
> Another option is using libc-6, which is likely to support threads
> 'natively'.

Just to clarify things further since I've done a bit of development using
threads under Debian 1.3.1 using both libc-5 and libc-6.  First, yes, as
Remco suggests with the straight Debian 1.3.1 using libc-5 you do indeed
need the pthreads package as well.  I've had no real problems this other
then when I port things over to Solaris I noticed that Solaris doesn't
support all of the same pthread features that the Linux pthreads does
(i.e. recursive locks, etc).

I've also tried out libc-6.  This does appear to contain the pthreads
support built into it.  All of my threaded code still compiles and works
properly using libc-6 but I did have to remove the pthreads package that
I used for libc-5 since it conflicts with libc-6.

>  : Are there seperate considerations for X ? I read somthing that was talking
>  : about thread support under X, but I couldn't figure out how it related to
>  : non-X thread support. Does Debian's Xlib or some other package support
>  : threads?
> I haven't found a thread-safe Xlib package yet in the Debian distribution. I
> have RPM and TGZ Xlib-3.{2,3} available on ftp
> (ftp://oloon.student.utwente.nl/pub/Mnemonic/X11/) if you need them.

I haven't found any of the Xlib stuff thread safe either.  I'm doing some
development using Xlib and did some basic testing under threads and found
it would hang X-windows or even crash X-windows when trying to do threaded
X-window calls.  I have found though that you can do threaded development
using the current non-thread safe X libraries by carefully organizing
your code.  I've relagated ONE thread to do ALL of my X calls, and the
other threads to do my other number crunching.  I've had no problems
with this and everything seems to work find.  It is a bit difficult though
to design the code just right.


Richard Dansereau
Email: rdanse@pobox.com          Home page:  http://pobox.com/~rdanse
Electrical and Computer Engineering - University of Manitoba - Canada

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: