Operating System Concepts ( Multi tasking, multi programming, multi-user, Multi-threading )
Basic Concepts of Operating System
Operating system acts as an interface between the user and the hardware. It is something which relieves the user from bothering about hardware related issues. It creates a user-friendly environment wherein the user needs to focus only on the program's logic and need not to write the code for the functions required to access hardware.
For example, if the user wants to print something then he or she simply uses the print function. This now acts as a system call and now the operating system will itself understand this and will deal with the hardware to get it done. User does not require to interfere anyhow.
Moreover, it acts as a resource allocator also and takes care that all the running programs can access the hardware with a fair share.
Multi tasking : In a multi tasking environment, operating system ensures that multiple tasks run on a single system by sharing the CPU time. Though they access the CPU one by one, it appears to the user that all the tasks are running simultaneously.
For example, while one has opened multiple tabs in a single browser and whenever the user switches from one tab to another, operating system schedules the current process to access the CPU. However, user is never concerned and this is how multi tasking is achieved.
Multi programming : It is the most important feature of an operating system wherein multiple programs reside in the main memory at the same time and the operating system ensures that whenever one process i.e., program in active state goes to wait for I/O devices then it schedules another process to access the CPU.
The most important aim here is not letting the CPU remain idle or waiting for any process to resume from the I/O work. OS always takes care of that.
Multi user Operating System : In this kind of environment, multiple number of users can access a single device or processor at the same time and the operating system ensures that one user's work never interferes with other's work.
For example, a common printer device is shared among multiple users within an organization. Now operating system schedules the processes of various users accordingly.
Multi threading : A thread is a light weighted process or a part of a process. A process is broken into various threads which share some common resources of the parent process and possess some separate resources too and work independently for accomplishment of the entire process. This concurrent execution of multiple threads of a process is called multi threading. Its concept is very much like multi programming wherein multiple processes are there.
Types of Operating System - Batch operating system, Time-sharing systems, Distributed OS, Network OS, Real Time OS