0
$\begingroup$

So i have asked this before, but i still didn't get my answer so I'll try to make my question more clear this time :

Based on my O.S book, Time sharing operating systems switch between processes very fast using a time slice and it uses interrupts when the time slice ends and switches to another process, so isn't this the definition of round robin CPU scheduling algorithm? so are they saying Time sharing O.S uses Round Robin cpu scheduling or what?

if not, then what is the relation? for example what happens if our O.S is time sharing and uses Round Robin cpu scheduling vs when it uses another algorithm like FCFS?

$\endgroup$

1 Answer 1

1
$\begingroup$

No. A time-sharing computer switches between processes in some way or other. A time-sharing computer with round-robin scheduling switches between processes in a particular way. For instance, suppose there are three processes, A, B, and C. A round-robin scheduler would switch between them in the order ABCABCABCABC etc. Some other scheduler might switch between them in the order AABAABAACAABAABAAC (for instance). Both are examples of time-sharing, but the latter is not a round-robin scheduler.

I suggest reading https://en.wikipedia.org/wiki/Scheduling_(computing).

$\endgroup$
4
  • $\begingroup$ So correct me If I'm wrong : in time sharing computers, no matter what the scheduling algorithm is, in fixed time intervals our O.S puts the process which is in the running state to the ready state and runs the scheduling algorithm, right? if so then does that mean even if the same process is gonna get scheduled again we still gonna have context switching? $\endgroup$
    – John P
    Commented Jul 13, 2018 at 12:00
  • $\begingroup$ @JohnP, I don't think that's not necessarily correct. Some time sharing computers may use varying time intervals too; there is no requirement to use fixed time intervals. "Time-sharing computer" is a broad category that encompasses many possible methods for running multiple processes. $\endgroup$
    – D.W.
    Commented Jul 13, 2018 at 16:57
  • $\begingroup$ But if you replace fixed to variable in my definition, then its correct right? i just want to know if it does put running processes to ready state in variable intervals, then what happens if it has to again put the same process to the running state? isn't this a lot of overhead? $\endgroup$
    – John P
    Commented Jul 14, 2018 at 16:42
  • $\begingroup$ @JohnP, looks right. This isn't the place for interactive back-and-forth discussions. I'm just talking about the definition of time-sharing; whether it is efficient or not will depend on the particular system and scheduling algorithm used. $\endgroup$
    – D.W.
    Commented Jul 14, 2018 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.