tfork()

I am looking at using tfork() in a QNX4 application. My created child task
(thread) will only be using the following library functions:

malloc()
Receive()
Reply()
memset()
memcpy()

Does any know if I would be safe in using tfork(). I don’t know if any of
these functions are thread safe in QNX4.

Thanks

Sure. I have done this on more that one occasion. I have several shipping
products
using tfork() in a configuration similar to what you describe. There seems
to be a lot
of misunderstanding about tfork(). Just think of tfork() as two processes
(I have
never used it for more that two processes), where the shared memory is
already
setup for you, and it just happens to be your regular old data segment.

Anything that you would do with two processes, and shared memory, can be
done with
tfork() (and vise-versa), and there is a less coding involved. It is not a
real threading
model but it is a convenient construct, that can be used to good effect for
a relatively
narrow range of problems (what you describe sounds like it fits into this
category).

“Tom Stave” <thstave@home.com> wrote in message
news:98ld3q$g0i$1@inn.qnx.com

I am looking at using tfork() in a QNX4 application. My created child
task
(thread) will only be using the following library functions:

malloc()
Receive()
Reply()
memset()
memcpy()

Does any know if I would be safe in using tfork(). I don’t know if any of
these functions are thread safe in QNX4.

Thanks

In article <98ld3q$g0i$1@inn.qnx.com>, "Tom says…

I am looking at using tfork() in a QNX4 application. My created child task
(thread) will only be using the following library functions:

malloc()
Receive()
Reply()
memset()
memcpy()

Does any know if I would be safe in using tfork(). I don’t know if any of
these functions are thread safe in QNX4.

I would NEVER use it with QNX4 … because that kind of ‘thread support’ was
allways the first step into a big chaos. Try to debug such ‘threads’ with the
Watcom debugger …

An reliable alternative for QNX4 are clean processes sharing all common data in
a shared memory segment.

Armin