* pthreads
@ 1996-02-06 5:00 Joshua Broch
1996-02-07 5:00 ` pthreads Dave Butenhof
1996-02-07 5:00 ` pthreads Daniel S. Riley
0 siblings, 2 replies; 3+ messages in thread
From: Joshua Broch @ 1996-02-06 5:00 UTC (permalink / raw)
Is anyone aware of a problem with the pthreads library for DEC Unix? If
I take a perfectly normal program, such as a hello world program, and
link it in with the pthreads library, the program SEGFAULTS immediately
on execution.
Any Ideas?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: pthreads
1996-02-06 5:00 pthreads Joshua Broch
@ 1996-02-07 5:00 ` Dave Butenhof
1996-02-07 5:00 ` pthreads Daniel S. Riley
1 sibling, 0 replies; 3+ messages in thread
From: Dave Butenhof @ 1996-02-07 5:00 UTC (permalink / raw)
Cc: broch+
Joshua Broch wrote:
>
> Is anyone aware of a problem with the pthreads library for DEC Unix? If
> I take a perfectly normal program, such as a hello world program, and
> link it in with the pthreads library, the program SEGFAULTS immediately
> on execution.
>
> Any Ideas?
This sort of question is fairly pointless without specifics. Such as,
what version of Digital UNIX? What's the program? How are you compiling
and linking? What options to compiler & linker? Shared or nonshared?
My guess is that you've linked it incorrectly. The correct way to
compile and link a simple C program on Digital UNIX 3.x that uses
threads is something like
cc -o hello -threads hello.c
If you're linking a shared library, or a C++ program (using an older
C++ without support for -threads), you need the following library
options AT THE END of the ld (or cxx) command...
-lpthreads -lmach -lc_r -lc
If you're testing Digital UNIX 4.0, that'd still be fine if you're
using the old cma or 1003.4a/D4 interfaces -- but you should be using
the 1003.1c-1995 interface and compiling with "-pthread" or linking
with "-lpthread -lmach -lexc -lc".
------------------------------------------------------------------------
Dave Butenhof Digital Equipment Corporation
butenhof@zko.dec.com 110 Spit Brook Rd, ZKO2-3/Q18
Phone: 603.881.2218, FAX: 603.881.0120 Nashua, NH 03062-2711
"Better Living Through Concurrency"
------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: pthreads
1996-02-06 5:00 pthreads Joshua Broch
1996-02-07 5:00 ` pthreads Dave Butenhof
@ 1996-02-07 5:00 ` Daniel S. Riley
1 sibling, 0 replies; 3+ messages in thread
From: Daniel S. Riley @ 1996-02-07 5:00 UTC (permalink / raw)
In article <Ul60J8K00ioBAI84Zr@andrew.cmu.edu>
Joshua Broch <broch+@andrew.cmu.edu> writes:
broch> Is anyone aware of a problem with the pthreads library for DEC
broch> Unix? If I take a perfectly normal program, such as a hello
broch> world program, and link it in with the pthreads library, the
broch> program SEGFAULTS immediately on execution.
You need the thread-safe versions of a bunch of libraries. If you are
using cc, link with 'cc ... -threads', not -lpthreads. If you are
using something like gcc that doesn't support '-threads', link
something with 'cc -v ... -threads' and copy what it does.
--
Dan Riley Internet: dsr@lns598.lns.cornell.edu
Wilson Lab, Cornell University HEPNET/SPAN: lns598::dsr (44630::dsr)
"Distance means nothing/To me." -Kate Bush
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-02-07 5:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-02-06 5:00 pthreads Joshua Broch
1996-02-07 5:00 ` pthreads Dave Butenhof
1996-02-07 5:00 ` pthreads Daniel S. Riley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox