Reputation: 583
When we start a thread Operating System puts that thread to run queue, and operating system's scheduler run that thread when the time(quantum) comes, so how operating system understands if that thread has finished it's operation?
Upvotes: 0
Views: 140
Reputation: 21607
There are generally two mechanisms for terminating kernel threads. They are the same as for terminating processes.
Upvotes: 1
Reputation: 93542
The thread calls an OS-specific function. That function tells the OS that its done. In most languages/frameworks this will be done behind the scenes for you.
Upvotes: 1