Messages in this thread | | | Date | Wed, 26 Aug 1998 15:36:01 -0400 | From | Anton Ghiugan <> | Subject | Who (and when) is calling the scheduler ? |
| |
The following question regards Linux's philosophy :
Linux is a multitasking operating system. That means that more than one processes can run 'in the same time' by what we call 'time-sharing' policy. Under normal circumstances the scheduler is called after every "return from syscall" and/or every "return from slow interrupt". The problem is: if in a given system I have only two user processes - two C programs shown bellow - wich does not need to make any library call, and thus don't call ever any system call, how will the system manage to schedule them since there is no "return from syscall" and no "return from syscall" [ Please, remember that our system is supposed to have no hardware device that can interrupt on a regular basis ] One can argue that the timer interrupt is interrupting the processor on a very regular basis - that's true - but, as we all can read in "Linux Kernel Internals" published at Addison-Wesley :
"The interrupt routine proper simply updates the variables `jiffies' and marks the bottom half routine (see Section 7.2.4) of the timer interrupt as active. This is called by the system at a later point ..."
This implies that, in our hypotetical case, the scheduler is never called ! Still, both of the process are running correctly. Why ?
Thanks,
Anton Ghiugan
---- Sample example of a program who is no running without making any sustem call ------
---> cut here
void main(void) { while(1) ; }
---> cut here
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html
| |