Asked By : swdeveloper
Answered By : azam
All the jobs that enter the system are kept in the job pool. This pool consists of all processes residing on mass storage awaiting allocated of main memory. (Source)
When a job has to get executed, it needs to be residing in the main memory. But, due to the limitation of size of main memory, only the parts of job which are currently being executed are transferred onto main memory, and the rest reside in virtual memory. So, in short, jobs which are created are sent to the job pool and are waiting to get their required resources and to get executed.
Why don’t we send processes directly to memory?
Not always, is the main memory free. So, the job scheduler comes into the picture. Because it is the job of the job scheduler to pick jobs from the job pool. Because, by default the job scheduler must be using some heuristic to schedule jobs i.e. according to priority or FIFO etc. You cannot break the custom and force it directly to the main memory, as that is the job of the job scheduler. This process, might have a bit of performance overhead, I understand, but things are pretty organised this way (the OS is so designed), and ensures no process starves. All the jobs in the system mean the jobs in the hard disk and the jobs in the main memory combined. So, jobs in the memory are a subset of the total jobs in the ‘system’.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/51999