Reputation: 12539
In one of the multithreaded Linux application, the application quits without deleting the thread. Will this cause any thread resource leakage. If this application is launched many times during the course of the day, will the system crash?
Upvotes: 2
Views: 1334
Reputation: 51147
For the most part, all resources used by a program are cleaned up when the program exists. There are a few exceptions (partial list here, no doubt):
Other than that, pretty much everything is cleaned up. Including threads.
Naturally, you should test this.
Upvotes: 4
Reputation: 131570
The kernel generally cleans up a process's resources (open files, threads, allocated memory, etc.) when it exits, so I don't think you need to worry. Although it could be stylistically better to delete the thread explicitly, possibly depending on your preferred coding style.
Upvotes: 3