Tom Stave <firstname.lastname@example.org> wrote:
I am looking at using tfork() in a QNX4 application. My created child task
(thread) will only be using the following library functions:
malloc is risky. The problem is that both “threads” would share the
same data segment, and so the same data chain. Can you pre-allocate
some memory the thread will use, and let it manage that memory itself?
Maybe give it a pool of buffers, or something like that?
If using malloc, are you also using free()? It has similar issues.
The others are fine.
(malloc may be labelled as “thread safe” – but that implies _beginthread()
rather than tfork(), as that enables some library thread-safing stuff. Not
complete, but better.)
QNX Training Services