Home > OS >  Linux multithreaded applications a thread calls the exit (0).
Linux multithreaded applications a thread calls the exit (0).

Time:11-11

Linux multithreaded program a thread, please call the exit (),
How and when each thread to exit?
The whole process of resources when to release?
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Baidu to:


But in the Linux kernel version version 3.10.0-1062.1.1. El7. X86_64 servers or there was a thread to exit, the destructor global data, lead to another thread to access a resource to produce the core file,

CodePudding user response:

Thread is a function, the easiest way out is the return is ok,
In general, I am such a process:
Within the main function is to create a multi-threaded, do things within the child thread, do it directly return the thread will exit, in the main function to judge if all threads are out of the release of resources, the main function
  • Related