i read that ther's smthin called a scheduler that picks a process and gives it to the cpu for execution.....but scheduler is also a some code running?
so who runs this scheduler thing? cpu? what if ther's a single processor ? how can cpu run two set of code at the same time?
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
in the past I used homemade scheduler on microcontrollers, where many times there in no room for an operative system or a simple kernel, too. In that case I used a well known trick: you use an hardware interrupt from an internal clock in order to switch from one task to another. The single processor just jumps to an ISR (Interrupt Service Routine) where you save current task context (stopping it) and load next task context (running it), up to the next timer interrupt.
like after a process completes execution.....it generates a system call and next one in ihe queue is loaded for execution....is it this way sir?
Not the answer you are looking for? Search for more explanations.
yes, Avinash, you're right. May I suggest you this reading:
It's an open source Real Time Operative System well documented and simple to use.
I think it's useful for students, too.
sir....what about modern operating systems?
sm1 has to choose a process among several processes bases on priority?
On most systems there is a priority scheme for the scheduler, that allows each task to consume some of the CPU time
but, if there's any need, a task can also raise a flag (let's say an interrupt) to signal it has an urgent call to serve
So ther's s no physical code that requires cpu attention all the time
it is just a priority queue that deques it's elements regularly
one processor (single core) can execute one instruction each clock tick; the program counter tells it what is the next instruction, except that in hardware interrupts, that load the program counter with a preset address pointing to ISR
oh ok i get it
thank you sir! :)
you're welcome, but again I suggest you reading the Free RTOS docs