cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Multithreaded problem on HP-UX

From: Andrei Tarassov <andrei.tarassov_at_altiris.ee>
Date: Wed, 25 Aug 2004 13:23:26 +0300

I have managed to build openssl/curl so that my test application would
work!

>From some HP-UX manual I found that multi-threaded applications should
be compiled with -D_POSIX_C_SOURCE=199506L.

For openssl in configure I specified additional flags and libraries:
threads -D_REENTRANT -D_POSIX_C_SOURCE=199506L -D_POSIX_THREAD_SEMANTICS
-lpthread

For curl I specified the following options (-D_REENTRANT is most
probably redundant):
CFLAGS="-O2 -D_POSIX_C_SOURCE=199506L -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS" LIBS=-lpthread

This seems to help! Thanks for the clues!

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Andrei Tarassov
Sent: Wednesday, August 25, 2004 10:10
To: libcurl development
Subject: RE: Multithreaded problem on HP-UX

On my HP-UX box I found an older pre-built version of curl. I tried to
link with it using the same compilation/linkage options and the same
version of openssl (unless that old curl was linked statically or used a
fixed path to the ssl library). The test application worked! So I guess
the problem is in how I build the new curl... I will try to build curl
using the instructions you provided.

Thanks!

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Alexander
Krasnostavsky
Sent: Wednesday, August 25, 2004 09:55
To: libcurl development
Subject: RE: Multithreaded problem on HP-UX

The following I found for gcc (see step 3):

A few preliminary steps you should take before beginning any pthread
coding is to:
1. add #include <pthread.h> in your .c or .h header file(s)
2. define the #define _REENTRANT macro somewhere in a common .h or .c
file
3. In your Makefile make sure gcc links against -lpthread
4. Optional: add -D_POSIX_PTHREAD_SEMANTICS to your Makefile (gcc flag)
for certain function calls like sigwait()

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Andrei Tarassov
Sent: Wednesday, August 25, 2004 09:12
To: libcurl development
Subject: RE: Multithreaded problem on HP-UX

I guess that this is for original cc shipped for HP-UX. Are there the
same kind of options for gcc?

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Alexander
Krasnostavsky
Sent: Wednesday, August 25, 2004 09:00
To: libcurl development
Subject: RE: Multithreaded problem on HP-UX

On HP multithreading option is "-mt":
cc manual:
-mt Sets various -D flags to enable multi-threading and
               also sets -lpthread. For details see HP C Online Help.

Check that you compiled with this option.

The information contained in this message is proprietary of Amdocs,
protected from disclosure, and may be privileged.
The information is intended to be conveyed only to the designated
recipient(s)
of the message. If the reader of this message is not the intended
recipient,
you are hereby notified that any dissemination, use, distribution or
copying of
this communication is strictly prohibited and may be unlawful.
If you have received this communication in error, please notify us
immediately
by replying to the message and deleting it from your computer.
Thank you.
Received on 2004-08-25