In: Computer Science
1. Give the top five most popular operating systems of the world. Justify your answer and explain why they are the most popular.
2.(a) What is the biggest advantage of implementing thread in user space? What is the biggest disadvantage?
(b) What is the biggest advantage of implementing thread in kernel space? What is the biggest disadvantage?
ANS(1)Top five most popular operating systems of the world are
1.Microsoft Windows
Microsoft Windows has existed in one form or another since 1985, and it remains the most popular operating system for home and office computers. Its latest versions, including Windows 10, are also used on some tablets, and the OS is used on some web and number-crunching server computers as well. Computers from a wide variety of manufacturers can use Windows.
2.Apple iOS
Apple's iOS is one of the most popular smartphone operating systems, second only to Android. It runs on Apple hardware, including iPhones, iPad tablets and iPod Touch media players
3.Google's Android OS
Android is the most popular operating system in the world judging by the number of devices installed. Largely developed by Google, it's chiefly used on smartphones and tablets. Unlike iOS, it can be used on devices made by a variety of different manufacturers, and those makers can tweak parts of its interface to suit their own needs.
4.Apple macOS
Apple's macOS, successor to the popular OS X operating system, runs on Apple laptops and desktops. Based in part on the historic family of Unix operating systems dating back to research in the 1960s at AT&T's Bell Labs, macOS shares some features with other Unix-related operating systems including Linux. While the graphical interfaces are different, many of the underlying programming interfaces and command line features are the same.
5.Linux Operating System
Unlike many other operating systems, development on Linux isn't led by any one company. The operating system was created by Finnish programmer Linus Torvalds in 1991. Nowadays, programmers from all over the world collaborate on its open source code and submit tweaks to the central kernel software and other programs.
ANS 2.(a)The biggest advantage of implementing thread in user space are
1.Enables threads on systems without threads
The first, and most obvious, advantage is that a user-level threads package can be implemented on an operating system that does not support threads. All operating systems used to fall into this category, and even now some still do.
2.No kernel interaction required
When a thread does something that may cause it to become blocked locally, for example, waiting for another thread in its process to complete some work, it calls a run-time system procedure. This procedure checks to see if the thread must be put into blocked state. If, so it stores the thread’s registers (i.e., its own) [...] and reloads the machine registers with the new thread’s saved values. As soon as the stack pointer and program counter have been switched, the new thread comes to life again automatically. If the machine happens to have an instruction to store all the registers and another one to load them all, the entire thread switch can be done in just a handful of in- structions. Doing thread switching like this is at least an order of magnitude—maybe more—faster than trapping to the kernel and is a strong argument in favor of user-level threads packages.
Disadvantages:
1.No coordination with system calls
Suppose that a thread reads from the keyboard before any keys have been hit. Letting the thread actually make the system call is unacceptable, since this will stop all the threads. One of the main goals of having threads in the first place was to allow each one to use blocking calls, but to prevent one blocked thread from affecting the others. With blocking system calls, it is hard to see how this goal can be achieved readily.
2.Page faults block per-process if unaware of threads
Somewhat analogous to the problem of blocking system calls is the problem of page faults. [...] If the program calls or jumps to an instruction that is not in memory, a page fault occurs and the operating system will go and get the missing instruction (and its neighbors) from disk. [...] The process is blocked while the necessary instruction is being located and read in. If a thread causes a page fault, the kernel, unaware of even the existence of threads, naturally blocks the entire process until the disk I/O is complete, even though other threads might be runnable.
3.No automatic switching to the scheduler
ANS(b)The biggest advantage and Disadvantages of implementing thread in kernel space are
Advantages:
Disadvantages: