in reply to Re^2: Keeping children alive persistiently, intelligently
in thread Keeping children alive persistiently, intelligently
Non-thread safe code means that it can not be shared between threads, but ot does not mean that it can be used in a detached child thread.
The memory usage of threaded applications can be as small as forked applications as threads can (and should be) reused if done properly.
I usally work with queues with threads and detach all child threads right at the beginning. All requests and results get send then to queues. The main thread waits until the results have been received.