Operating system, concept
More detailed information is found in the documentation below.
A modern Operating System or OS is a complex piece of software that interacts with HW and the applications.
The OS is the interface between the applications and the HW.
Applications <---> OS <---> HW
The brain in the OS is the kernel. The kernel is responsible to access the resources, in this case the HW, and distribute it fairly to the applications in the OS.
The applications consist of processes which are programs in execution in the memory.
One application may contain one process or many processes and each of these processes need to access the resources.
In a modern OS to be more effective an application uses threads. A thread is a lightweight process that takes less resources than a process.
It's a process who creates a thread. This is apparent when for example a web server receives thousands of request each minutes.
For example if you play CS or LOL, the games will need to access the following HW in your system simultaneously:
- Ethernet interface
The user believes that this is done at the same time. The user doesn't notice that the kernel is very busy to access the resources in different time frame.
This is what we call multitasking, to perform multiple tasks (also known as processes) over a certain period of time by executing them concurrently.
To do that the kernel uses a scheduler. The scheduler in the kernel decides which process is allowed to access a specific resource.
There are many scheduling algoritm. The most common algoritm is RR, Round Robbin.
Note: If your machine has an old CPU this will cause an overload which will heat the CPU and the fan will run heavily.