Skip to content
Advertisement

Tag: scheduling

What’s the purpose of `on_rq` field in `task_struct`?

I am now reading the source code of try_to_wake_up() function of Linux Kernel. This function does a lot and includes this: return p->on_rq == TASK_ON_RQ_QUEUED. So, what is the actually purpose of on_rq field in task_struct. BTW, does there exist some manuals or reading materials to introduce all the fields in task_struct? I think a fully understanding of these fields

Who schedules threads?

I have a question about scheduling threads. on the one hand, I learned that threads are scheduled and treated as processes in Linux, meaning they get scheduled like any other process using the conventional methods. (for example, the Completely Fair Scheduler in linux) On the other hand, I also know that the CPU might also switch between threads using methods

Linux SCHED_OTHER, SCHED_FIFO and SCHED_RR – differences

Can someone explain the differences between SCHED_OTHER, SCHED_FIFO and SCHED_RR? Thanks Answer SCHED_FIFO and SCHED_RR are so called “real-time” policies. They implement the fixed-priority real-time scheduling specified by the POSIX standard. Tasks with these policies preempt every other task, which can thus easily go into starvation (if they don’t release the CPU). The difference between SCHED_FIFO and SCHED_RR is that

How Linux handles threads and process scheduling

I’m trying to understand how Linux handles process scheduling and thread scheduling. I read that Linux can schedule both processes and threads. Does Linux have a thread scheduler AND a process scheduler? If yes, how do they cooperate? Answer The Linux kernel scheduler is actually scheduling tasks, and these are either threads or (single-threaded) processes. So a task (a task_struct

Advertisement