I wonder which was the first operating system that had context switch and what are famous examples of OS that didn't have context switch?

  • 6
    Define context switch. Any system that supports interrupts does context switching, and on a conceptual level, using WordStar for an hour and another hour Multiplan on a CP/M machine is a context switch as well. Even a pocket calculator that has "M+" and "RM" keys supports context switching on a conceptual level. As it is now, there cannot be a definitive answer to this question. – tofro Aug 1 '17 at 11:48
  • 2
    Even a device as simple as an Abacus supports the concept of context switching. – tofro Aug 1 '17 at 11:56
  • @tofro Saving the stack of the current thread and changing it? – Niklas Rosencrantz Aug 1 '17 at 12:27
  • 1
    @tofro How do you do context switching with an abacus? Take a photo of it? – JeremyP Sep 4 '17 at 8:46
  • 1
    @JeremyP For example. Or just use another set of rows, leaving the ones you just have worked with alone for a while. – tofro Sep 4 '17 at 8:54

The first operating system to implement context switches as we understand them today was the Atlas supervisor. Quoting T. Kilburn, R. B. Payne and D. J. Howarth’s 1961 paper on The Atlas Supervisor (printed in AFIPS Computer Conference 20 and in Per Brinch Hansen’s Classic Operating Systems):

While one program is halted, awaiting completion of a magnetic tape transfer for instance, the co-ordinator routine switches control to the next program in the object program list which is free to proceed. In order to maintain full protection, it is necessary to preserve and recove the contents of working registers common to all programs such as the B-lines, accumulator, and control registers, and to protect blocks in use in core store.

The idea itself was first described by Christopher Strachey in his 1959 paper, Time sharing in large, fast computers; the main purpose was to allow computers to switch tasks when one task was blocked waiting on I/O. Interactive task-switching followed shortly; the first demonstration of that was CTSS in 1962 (this is what ended up being known as time-sharing; Strachey’s concept is referred to as multi-programming). In fact John McCarthy floated the idea of time-sharing in an unpublished memo dated January 1, 1959, so both concepts were contemporaneous.

Strictly speaking any operating system which supports hardware interrupts has to support some form of context switching, even if it is strictly single-tasking (like MS-DOS). So the only operating systems which didn’t have any form of context switching were the few batch processing operating systems in the late ’50s such as BKS on the Philco-2000.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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