What happens to threads when exec() is called? What happens to threads when exec() is called? multithreading multithreading

What happens to threads when exec() is called?


On POSIX-compliant Unix-like systems:

A call to any exec function from a process with more than one thread shall result in all threads being terminated and the new executable image being loaded and executed. No destructor functions or cleanup handlers shall be called.

After exec* completes, there is just one thread.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html

(Incidentally, I think they meant to write "A successful call to any exec function...", as the text makes no sense for unsuccessful calls.)