[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference clt::cma

Title:DECthreads Conference
Moderator:PTHRED::MARYSTEON
Created:Mon May 14 1990
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1553
Total number of notes:9541

1472.0. "libthread or libthreads?" by BGSDEV::STAM (Darrell Stam, Learning how to talk to computers) Fri Jan 24 1997 16:58

I'm trying to isolate a bug in our program and it all comes down
to our use of the threads package.  I realize that threads have
changed between UNIX V3.2x and UNIX V4.0x versions.  In building
our project we use the -threads switch as one of the flags in the
CFLAGS line of our makefile.  Is this still necessary to use if
I'm building the project on a UNIX V4.0x system?

The second question is - what's the difference between
/usr/shlib/libpthreads.so and
/usr/shlib/libpthread.so?  Why are there two libraries and
which one should I be using - or should I be using both?

	 - Darrell
T.RTitleUserPersonal
Name
DateLines
1472.1SMURF::DENHAMDigital UNIX KernelFri Jan 24 1997 20:2412
    If you're still coding to the Draft 4 interfaces (pre-V4.0), then
    you need to use -threads on V4.0. That gets you the "legacy"
    treatment to support the old interfaces.
    
    The legacy layer is in libpthreads.so. The DECthreads "core"
    functions, which the legacy layer uses, are in libpthread.so.
    
    If you write a nice up-to-date POSIX.1c program on V4.0, you
    build with -pthread, and you'll be linked against libpthread.so.
    The libpthread library won't be used.
    
    Hope I've covered the issue. Well, OK for a kernel guy....
1472.2DCETHD::BUTENHOFDave Butenhof, DECthreadsMon Jan 27 1997 10:578
>    If you write a nice up-to-date POSIX.1c program on V4.0, you
>    build with -pthread, and you'll be linked against libpthread.so.
>    The libpthread library won't be used.

Just so nobody gets confused, Jeff meant "The libpthreads library" won't be
used, not "The libpthread library".

	/dave
1472.3Nevermind! Just use the right switch.WTFN::SCALESDespair is appropriate and inevitable.Mon Jan 27 1997 14:0115
.0> Is this still necessary to use if I'm building the project on a UNIX V4.0x
.0> system?

Yes, sadly, using a special switch to instruct the compiler that you are
compiling/linking code for use with threads will probably always be necessary.  

.0> Why are there two libraries and which one should I be using - or should I be 
.0> using both?

In general, you shouldn't care!  As long as you are specifying the correct
switch (either -thread or -pthread, whichever is appropriate), the compiler
(driver) will select the appropriate library or libraries -for- you.


				Webb