Sometimes threads fell that they run long time, and they give their turns to another threads by means of thread scheduling procedure.

1) I wonder what happens if a thread does not want to stop itself, and it wants to continue running.

2) If another thread want to take the turn of the thread which do not want to stop, what happens ?

closed as too broad by Michael Homer, mdpc, G-Man, Satō Katsura, Kiwy Mar 6 '18 at 9:23

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


In most modern operating systems, including Linux, task (process/thread) scheduling is preemptive – controlled by the kernel. A task cannot choose not to stop and cannot choose to take the turn of another task. In general, tasks are oblivious to the fact that CPU scheduling is even happening.

Not the answer you're looking for? Browse other questions tagged or ask your own question.