execl() question, please help

In the documentation of the execl() function, it says that
“If you call this function from a process with more than one thread, all of
the threads are terminated and the new executable image is loaded and
executed. No destructor functions are called”.

My calling process is a multi-threaded process, and there will be
dynamically created arrays, pointers, fds and so forth that won’t be cleaned
up if the destructor does not get called.
My question is, what is the best procedure for running this execl()
function? without causing memory leaks, etc…

Any helps would be greatly appreciated.

In article <bq66jq$mii$1@inn.qnx.com>, tburhan@dodo.com.au says…

In the documentation of the execl() function, it says that

Please do not spame these newsgroups. I have been reading it third time for this evening.
Best regards,
Eduard

“If you call this function from a process with more than one thread, all of
the threads are terminated and the new executable image is loaded and
executed. No destructor functions are called”.

My calling process is a multi-threaded process, and there will be
dynamically created arrays, pointers, fds and so forth that won’t be cleaned
up if the destructor does not get called.
My question is, what is the best procedure for running this execl()
function? without causing memory leaks, etc…

Any helps would be greatly appreciated.

You can call “spawn” from a multi-threaded program, if you want
to launch another program and continue the one you are in.

“exec”, in a program with multiple threads, is not a good thing.
You’re yanking the code out from under running threads, so the
system has to kill them.

QNX does not implement “fork” for a program with multiple
threads. There are UNIX variants that do, although the semantics
vary.

John Nagle
Team Overbot

inn.qnx.com wrote:

In the documentation of the execl() function, it says that
“If you call this function from a process with more than one thread, all of
the threads are terminated and the new executable image is loaded and
executed. No destructor functions are called”.

My calling process is a multi-threaded process, and there will be
dynamically created arrays, pointers, fds and so forth that won’t be cleaned
up if the destructor does not get called.
My question is, what is the best procedure for running this execl()
function? without causing memory leaks, etc…

Any helps would be greatly appreciated.