thread safety

Does anyone know of a list of C/C++ commands/functions that are/are not
thread safe?

Doug Rixmann <rixmannd@rdsdata.com> wrote:

Does anyone know of a list of C/C++ commands/functions that are/are not
thread safe?

I would tend to strongly discourage the use of threading under
QNX4 – QNX4 does not have a true thread model. (QNX 6 does.)

For QNX 4, you essentially have 2 seperate processes that share
the same code & data segments. They do not share the same messaging,
that is a message to one, can not be replied to by the other, or
other such parallelism that might be expected in a true threading
environment.

More of the library is thread-safe if you start your threads with
_beginthread() than if you use tfork(), and you are more likely
to succeed in a C environment than in a C++ environment.

If compiling for C++, you will almost definitely want to compile with the
cc -WC,-bm option.

If you have a moderately recent version of the Watcom docs, there should
be a safety table at the end of each function, and this includes
thread-safety information – but that table assumes _beginthread()
rather than tfork(). Also, threaded behaviour of library functions
has not been heavily tested.

Again, I generally recommend NOT doing this, but instead to use
cooperating processes, with an explicit area of shared memory
created by shm_open() and mmap() rather than using the automatic
sharing from threading.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.