Task_Running Process State

Task_Running Process State

I am reading "Linux Kernel Development". It has definition about "TASK_RUNNING"

"TASK_RUNNING—The process is runnable; it is either currently running or on a runqueue waiting to run". My question is why don't we have two separate state for "currently running" and "on a runqueue waiting to run". Like TASK__RUNNING and TASK_READYTORUN.

1) because when I first look at word "TASK_RUNNING", I thought it just refers to a running process state 2) more exact definition would avoid many troubles

So do we have strong reasons not to do this ??

1 Answer

The process is runnable.

Futher state separation has no sence from the view of users of this field.

Because users of that state are not interact with a scheduler, knowing whether a process is scheduled or not is useless: immediately after you obtain that knowledge, the scheduler may change that property, so your knowledge becomes invalid.


As for name TASK_RUNNING, only Linux developers knows why it is choosen. It could be historic reason, or intentionally: "Think of the process as if it is running."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Elena Rostova
Author

Elena Rostova

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.