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 is posted, but we’ll have Codespaces working by Monday
  • Monday in class we’ll introduce Project 1, which is due on Friday
  • Lecture recording is set – videos will go to Canvas
  • Slides available before class on bob.cs.ucdavis.edu

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)

  • Each job can work independently of the others
  • 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 ca 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

9 of 9

Examples!

  • Command line examples
  • Simple example about file descriptors