QNX4 thread secure calls

Hello!

I’m actual trying to port stuff to QNX4 and I’m sticking at pthreads.
The compilation with the pthread-1.0b4.tgz form ftp://ftp.qnx.com.
But the program crashes and using the debugger I see that it crashes in “getenv” called from “socket”.
The “socket” function is threadsafe due to the watcom online help but
the “getenv” isn’t.

Can it be true that QNX calls their own functions like “socket” threadsafe without checking the functionality?
How can a function be thread safe if it uses calls unsafe functions?

I don’t believe the TCP/IP library is thread safe.

QNX4 doesn’t support threads, the pthreads library is a kludge you have to be very careful about what you are doing. Make sure you read the doc that came with the pthread stuff.

Today I had success implementing the GNU pth-2.0.7 pthread emulation in QNX4+Watcom10.6.
The stuff is compiling and the program I have to port is not crashing like it was doing with the pthread-1.0b4.tgz.
Looks good. I keep you informed.

Ouch that’s a non-preemptive implementation, kind of beats the goal?

Your absolutely right!!
But I need the the modularity and stability of QNX4.
My company has several products running on QNX4 and for the new stuff there is no “realtime” needed.

I hear you ;-)