1 of 30

Science : Operations Systems ��Process management, scheduling, dispatching and synchronization in an operating system.

2 of 30

PLAN

  1. Managing processes in the operating system
  2. Process planning
  3. Process dispatching and synchronization
  4. Process scheduling algorithms and parameters

3 of 30

Managing processes in the operating system

An important characteristic of a process : it is a unit of computation that must be executed sequentially, that is, each process is a sequence of instructions with its own sequential control flow . A process created and managed by the OS contains the following basic information:

  • Program counter (PC) - the address of the current instruction being executed; usually stored in a special system register of devices;
  • The stack is a permanent area of main memory allocated by the OS when a process is created, where the operating system stores local data of the process procedures, their parameters (arguments) and data necessary for organizing calculations. When the next procedure is started, an activation record is given on the stack, and the stack frame and local data area are used to store the local data of the procedure .
  • Data section is a static (permanently allocated, fixed-size) area of main memory allocated to a process by the OS , where global variables, arrays, structures, and objects are stored. The executable code (instructions) of the process is initially stored in secondary memory (disk) and is loaded into main memory in whole or in part when it is accessed.

4 of 30

Basic concepts of process control subsystem

  • Multitasking operating systems can execute multiple processes simultaneously.
  • Processes can often appear at the initiative of the user and his applications, and this is called a user process.
  • Processes initiated by the operating system to perform its functions are called system processes.
  • The set of operating system memory areas allocated to a process is called the address

5 of 30

Main functions of the process control subsystem

  • Process creation and destruction (data structure associated with the process);
  • Support process request queue for resources;
  • Protecting resources allocated to the current process from other processes that are organized to use shared resources;
  • Ensuring that certain processes stop and start again;
  • Providing an interprocess communication tool.

6 of 30

Process control unit

  • Process Control Block (PCB) is a system data structure used to control a process, containing the following information related to each process:

7 of 30

Process control unit

  • Process identification number (ID);
  • Process status;
  • The current value of the command counter (used to continue the execution of the process);
  • Processor register values (also used in process recovery) ;
  • Information for processor scheduling (pointer to process stack, process number);
  • Information for memory management (boundaries of the process memory space);
  • Resources (allocated for process execution);
  • Account information (total execution time of the process remaining from the declared execution time, total I/O time, etc.);
  • Information about input/output status (list of open files).

8 of 30

Process Control Block (PCB)

9 of 30

Operating system table

10 of 30

Task, process, flow

11 of 30

the CPU ceiling from the process to the process to pass management

12 of 30

The process planning status

  • Queue work
  • Ready turn
  • Queue device

winword.exe, notepad.exe, TOTAL64.exe

13 of 30

ready turn and different kind input / output devices

14 of 30

Process – addresses area

0x00000000

0xFFFFFFFF

Virtual

address space

code

(text)

static data

heap

( separated dynamic memory )

Kernel Code and Data

PC

SP

User Space

stack

(dynamically allocated )

Kernel Space

32-bit Linux & Win XP – 3G/1G user space/kernel space

15 of 30

Process – address space

16 of 30

descriptor concept

  • Descriptor – operational in the system processes keeps .

17 of 30

Transition from one process to another

  • When managing processes, the OS ensures that they are executed sequentially. This task is handled by the OS scheduler.
  • For example, given two processes - J0 and J1.
  • If the J0 process has an interrupt or system call, the operating system saves its state on the PCB and transfers the processor to the J1 process (the J1 process is also handled in a similar way). The execution and stopping times of each process are shown .

18 of 30

Transition from one process to another

19 of 30

Queue diagram for

20 of 30

Process planning

  • When a computer is multitasking, it often has multiple processes or threads running at the same time, using the processor. This occurs when two or more processes or threads are ready at the same time .
  • If there is only one processor, the processes must be chosen to run sequentially. The part of the OS that makes this choice is called the scheduler , and the algorithm that uses it is called

21 of 30

Process planning

  • Most of the issues related to process planning are similar to flow planning, but there are some differences.
  • When the kernel manages threads, thread scheduling is usually individual to each of them, regardless of which process they belong to.
  • The focus will be on planning issues related to processes and flows first. After that, the focus will be on planning flows only and some of the unique challenges that come with it.

22 of 30

Process scheduling algorithms

  • First Come First Serve (FCFS) Scheduling – first come, first served
  • Shortest-Job-First (SJF) Scheduling – Reducing time
  • Priority Scheduling
  • Round Robin (RR) Scheduling – Each process is assigned a specific time and is executed at that time
  • Multilevel Queue Scheduling – each set of processes has its own algorithm and corresponding priority

23 of 30

Planning algorithms

  • Planning from algorithms one many step by step Queue (Multilevel Queue Scheduling) since the 1950s-60s applied This strategy is coming . processes one how many to the group classification possibility when is applied .
  • Queues following rule based on works : no small​ priority has a process to it priority big until the process is completed to work does not fall

24 of 30

Multilevel Queue Scheduling – Many step by step turn

  • Many step queue ( Multilevel Queue) at every kind next processes 2​ is separated :
  • Interactive processes turn ( less time demand the one who does );
  • Background in mode processes turn ( many) resource demand annoying , but fast execution condition not been ).

Every one of the turn balance save standing own planning queues there is :

  • Interactive RR(Round Robin) in processes ;
  • Background in mode FIFO (First in First Out)

Many step by step turn processes

Interactive processes

Background in mode processes

25 of 30

Queues between planning

  • Priorities based on planning :

- first become all interactive processes will be done then background those in the regime .

  • Times to be based on :

- his/her processes between planning for every one MP time to queue one part allocated , for example , 80% of MP time is interactive processes for RR (Round Robin) , 20% background in mode processes via FIFO for .

  • Many step by step turn again communication with

Systematic

Interactive (“ exactly ”)

Interactive (“ current ”)

Packaged processes

User to work dropped

26 of 30

Many step by step turn again communication with (Multilevel Feedback Queue Scheduling)

Spent time based on planning , if the process is clear quantum time spent If it is dynamic , it is again planned next will be placed .

If necessary fast if done then it is the first " fast " process next falls .

If the average time demand if it does , then middle next falls .

If many time demand If so , then FIFO last next falls .

This on account of processes always queues between move walks . That's why processes for​ placement and his/her status change need it's not .

Quantum 32 ms

Quantum 64 ms

FIFO

27 of 30

First Come First Serve (FCFS) scheduling algorithm

28 of 30

Synchronization

Let's look at threads in Windows and Linux operating systems and their synchronization mechanisms that prevent access to shared resources .

29 of 30

Control questions

  • 1 .
  • 2. What are process components and explain them?
  • 3. What are the process states?
  • 4. What operator is used in UNIX to create processes?
  • 5. What is the sequence of creating processes?

30 of 30

References