Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is process scheduling not called thread scheduling?

I found out that Linux and Windows both schedule threads and not processes.

Source

So I don't understand why we call it "process scheduling" any more. Shouldn't we be calling it thread scheduling? The idea of shared memory for threads of the same process just seems to be a technicality that has to be taken care of while actually running the threads (we could assume 2 threads of the same process to be a 2 single threaded processes sharing memory).

Are there any operating systems that schedule processes and when it is time for a process to run, specially decide how to run its threads?

like image 288
batman Avatar asked Sep 05 '26 03:09

batman


2 Answers

OS-scheduled threads are a relatively new feature. It was not that long ago when a separate path of execution on Unix meant creating an entirely new process. So there is historical resistance.

Some systems (Unix variants, VMS) schedule processes, not threads. Process scheduling is likely to remain the way to go in real time operating systems.

like image 177
user3344003 Avatar answered Sep 08 '26 12:09

user3344003


In process scheduling resources are allocated to each process differently i.e suppose you create 2 processes then each process will get his own resources(file buffer,i/o files, CPU control etc). In this, time is wasted when scheduling is done. As first process is called then resources are allocated to that process when second process is called then resources are allocated to that process so resources are allocated separately to each process and also context switching time increases during scheduling. Thread is basically a small unit of process. So one process can have many threads. But here resources are shared between different threads as they are one part of process, so multitasking is available and also context switching time is less.

like image 39
Karan Jawalkar Avatar answered Sep 08 '26 13:09

Karan Jawalkar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!