1 of 9

ECS 150: History of OS and introduction to processes

Sam King

2 of 9

Administrative

  • No discussion or office hours this week, both will start next week
  • Project 1 will be posted today
  • We’ll introduce Project 1 on Friday or Monday
  • We’ll try Zoom today for recording lectures

  • Please ask questions during lecture!

3 of 9

Processes and concurrency

  • Motivation
    • OSes getting complex
    • Multiple users, programs, I/O devices, etc.
    • How to manage this complexity?

  • Decompose or separate hard problems into simpler ones

4 of 9

main() {

getInput();

computeResult();

printOutput();

}

getInput() {

cout();

cin();

}

computeResult() {

sqrt();

pow();

}

printOutput() {

cout();

}

Programs decompose into several rows

main

getInput

cout

5 of 9

  • Processes decompose mix of activities running on a processor into several parallel tasks (columns)

  • Original OSes were just one big program
  • Dykstra introduce THE to simplify
    • Each job can work independently
  • Remember, for any area of OS, ask:
    • What interface does the hardware provide?
    • What interface does the OS provide?

Job 1

Job 2

Job 3

6 of 9

What’s in a process?

  • Definition of a process
    • (informal) a program in execution. A running piece of code along with all the things the program can read/write
      • Note: process != program
    • (formal) one of more threads in their own address space
  • Play analogy

7 of 9

  • Thread
    • Sequence of executing instructions from a program (i.e., the running computation)
    • Active
    • Play analogy

  • Address space
    • All the data in the process uses as it runs
    • Passive (acted upon by the thread)
    • Play analogy: all the object on the stage in a play

8 of 9

Key abstractions

  • Process
  • File system
  • File descriptor
    • Files
    • Pipes
    • Sockets
    • Devices
    • And more
  • System calls

9 of 9

Examples!

  • Command line examples
  • Simple example about file descriptors