9
Cpr E 308 Spring 2004 Recap for Midterm Introductory Material • What belongs in the OS, what doesn’t? • Basic Understanding of Hardware, Memory Hierarchy

Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy

Embed Size (px)

Citation preview

Page 1: Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy

Cpr E 308 Spring 2004

Recap for Midterm

Introductory Material

• What belongs in the OS, what doesn’t?

• Basic Understanding of Hardware, Memory Hierarchy

Page 2: Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy

Cpr E 308 Spring 2004

Process

• What’s a process?– Unix Process Creation

– Shell Assignment (fork and exec)

• Address Space– Stack, heap, data and text regions

• What data items go where?

– What do fork() and exec() do to the address space

Page 3: Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy

Cpr E 308 Spring 2004

System Calls

• How are they handled?– How are they different from regular function calls?

– Changing from user to supervisor mode and back

• Some important system calls (including wait())

Page 4: Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy

Cpr E 308 Spring 2004

Multiprogramming

• What is it?

• Process Context Switch

• How are interrupts involved?

Page 5: Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy

Cpr E 308 Spring 2004

Threads

• When are they useful?

• Difference from processes

• Basic thread operations – creation, joining, exiting, etc

• Thread Implementations – User and Kernel Threads

Page 6: Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy

Cpr E 308 Spring 2004

Mutual Exclusion and Synchronization

• What’s the problem with writing to shared variables simultaneously?

• What are critical sections, atomicity?

• Mutual Exclusion Problem – Clear definition

Page 7: Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy

Cpr E 308 Spring 2004

Mutex Solutions

• Software Solutions– Peterson’s solution

• Hardware Support– TSL instruction

• Disabling Interrupts– Advantages and disadvantages– Doesn’t work for multiprocessors – why?

Page 8: Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy

Cpr E 308 Spring 2004

Beyond Mutexes

• Condition Variables and Mutexes– Example programs using condition variables

• Semaphores (not in detail)

• Example Problems:– Producer and Consumer – Readers and Writers – Dining Philosophers – Deadlocks

Page 9: Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy

Cpr E 308 Spring 2004

Deadlocks

• Conditions for a deadlock

• Detection Algorithm

• Deadlock Prevention