HPUX and threads?

Jonathan Giddy jon at rdt.monash.edu.au
Wed Jul 28 16:45:17 EDT 1999


Markus Stenberg <mstenber at cc.Helsinki.FI> writes:

>Is HPUX-11 thread support tested/implemented/whatnot? 
Implemented - yes, tested - not in your environment (until now).

>This at least does not look promising..

># /opt/python/bin/python
>pthread_mutex_init: Invalid argument
>Memory fault(coredump)

OK, this is probably due to an incorrect guess about which version of 
pthreads is being used.

If you look at the beginning of the source file Python/thread_pthread.h
you'll see a series of preprocessor tests, defining PY_PTHREAD_D4 and 
friends.

It seems HPUX selects either Draft 4 or the final standard, based on whether
_DECTHREADS_ is defined.  Try placing the following after the #endif

#if defined(PY_PTHREAD_D4)
#error PY_PTHREAD_D4
#elif defined(PY_PTHREAD_D6)
#error PY_PTHREAD_D6
#elif defined(PY_PTHREAD_D7)
#error PY_PTHREAD_D7
#else
#error PY_PTHREAD_STD
#endif

make clean and recompile.  This will (hopefully) give you an error like:
In file included from thread.c:146:
thread_pthread.h:88: #error PY_PTHREAD_STD

which tells you which version was assumed.  Then, try undefining the
assumed value, and replace it with the likely correct value.

So, if you get PY_PTHREAD_STD, then replace the code above with:
#undef PY_PTHREAD_STD
#define PY_PTHREAD_D4

then make clean; make

That will hopefully get you running.  A more permanent solution requires
someone who knows the history of pthreads on HPUX.

Jon.




More information about the Python-list mailing list