Skip to main content

Posts

Showing posts with the label Operating System

Operating System: Threads and Concurrency

Threads Definition: A Thread also called lightweight process, is basic CPU utilization; it compromises a thread ID, a program counter, a register set, and a stack. A thread is an entity within a process that can be scheduled for execution. If we want a process to be able to execute on multiple CPUs at a time, to take advantage of the multi-core systems, the process must have several execution-context called threads. A thread is an active entity which executes a part of a process. Multiple threads execute simultaneously with each other which results in the execution of a single whole process. As several threads of a process execute at the same time they are required to maintain coordination with each other. Coordination between the threads is required in order to share system resources like I/O devices, memory, and of course CPU. The threads of a process are the part of the same virtual address space (i.e. they share all virtual to physical mapping), they share all the data, cod...

Operating System: Process and Process Management

Process In simple words, a process is an instance of an executing application. An application is a file containing a list of instructions stored in the disk (often called an executable file), in flash memory, maybe in the cloud but it's not executing, it's a static entity. When an application is launched it is loaded into the memory and it becomes a process, so it is an active entity with a program counter specifying the next instruction to execute and a set of associated resources. If the same program is launched more than once than multiple processes will be created executing the same program but will be having a very different state. A process encapsulates all the data for running application, this includes the text , the code of the program, a data section, which contains global variables and data which are available when the process is first initialized. As text and the data are available when the process is first initialized they are called static s...

Operating System: Introduction

What is an Operating System? An operating system is a layer of system software between applications and hardware that abstracts (i.e. simplify what hardware actually looks like) and arbitrates (ie. manage, overseas and control the hardware use). Functions of Operating System Hides hardware complexity: OS hides hardware complexity for applications as well as for application developers. Application developers, for example, don't need to worry about disk sectors or block when saving a file to the disk. In fact mechanism for reading/writing a file on a hard drive is different from reading/writing the file on a USB drive or SSD which is all handled by OS. Similarly, OS abstracts the network resource and provide a higher level abstraction called Socket and provide some services to send and receive packets from that socket. Resource Management: OS also manages the resources used by the application. It decides how many and which one of the above resources will b...