Docsity

Operating System Two - High Performance Computing - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download Operating System Two - High Performance Computing - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

High Performance Computing

Lecture 16

2

Operating System

Software that manages the resources of a computer system  Main memory  CPU time  I/O devices  Software resources

4

Process: A New Perspective

 We could view process as a data structure  What is a data structure?  Example: Stack  Defined by the operations that can be done on the associated data  In the case of the stack: Push and Pop  And a few more  Create, Destroy  We will discuss the idea of process in terms of a set of operations and the associated data

5

Process as a Data Structure

 What are the operations on processes?  Process related system calls  fork(), exec(), wait(), exit(), …  Recall: When we talked about the stack operations Push and Pop, we thought in terms of explicit data

  1. A contiguous region of memory (a 1-dimensional array)
  2. A Top of Stack Pointer

7

fork( ) and exec( )

text data heap stack Parent Process Child Process text data heap stack retval = fork(); if (retval == 0) { /* child / } else { / parent */ }

8

Process as a Data Structure.

 What is the data manipulated by these process operations?  Think about the fork() operation  Create a new process  Text, data, stack, heap copied from its parent process

10

Process as a Data Structure.

 What is the data manipulated by these process operations?

  1. Text, Data, Stack, Heap
  2. Data stored in hardware
  3. Other information maintained by the OS  Process identifiers  A unique name/integer for each process  With each process, also remember its parent process identifier

11

Process as a Data Structure.

 What is the data manipulated by these process operations?

  1. Text, Data, Stack, Heap
  2. Data stored in hardware
  3. Other information maintained by the OS  Process and parent identifiers  User identifier  The identity of the user who is running the program as a result of which the process was created

13

Process : A New Perspective

  1. We can view a process as a data structure
  2. We can view a process as an OS created abstraction  Like virtual memory, it does not really (physically) exist  It is just an OS interface for program execution  It is the unit of resource management by OS  There is a separate page table for each process  Unit of sharing of CPU time

14

Process vs Program

Some adjectives to describe these concepts  Program:  Process:  A process changes state with time  Example: After executing LW R5, - 8(R29), the value in R5 changes  as well as the values in PC, IR  and many other of the data items we listed  The process is said to be running static passive dead dynamic active living