Midterm review session CS 170 7 February 2019 --------------------------------------------------------------------------- Ground rules --75 minute exam --at 65 minutes, you have to stay seated; do not get up and distract your classmates. --you must hand your exam to us (we are not going to collect them). the purpose of this is to give everyone the same amount of time. --at 78 minutes, we will walk out of the room and won't accept any exams when we leave --thus you must hand in your exam at time x minutes, where: x <= 65 OR 75 <= x < 78 --exams are closed book. Also, put away electronics (phones, tablets, laptops, etc.). Material --Readings (see course Web page, the column called "Reading assignment") --Labs --Homeworks --NOT review sessions if the topic wasn't covered in other material (but the review sessions are specifically designed not to have such things) --Lectures --Operating systems: what are they? --goals, purpose --privileged vs unprivileged mode --user-level / kernel interaction: how does the kernel get invoked? --Processes: birth, life cycle, state diagram, implementation --what are they? (registers, address space, etc.) --birth: fork()/exec() --context switches (when? how?) --view of memory (call stack, heap, program code, etc.) --How the OS gets booted --system calls --shell --the fork()/exec() separation --the power of Unix's abstractions --threads --concurrency --hard to deal with; abstractions help us, but not completely --critical sections --mutexes --spinlocks --condition variables --monitors --lots of things can go wrong: safety problems, liveness problems, etc. --What's the plan for dealing with these problems? --safety problems: build concurrency primitives that get help from hardware (atomic instructions, turning off interrupts, etc.) and move up to higher level abstractions that are easy to program with --liveness problems: most common is deadlock, and we discussed strategies for avoiding it. other problems too: starvation, priority inversion, etc. --lots of trade-offs and design decisions --performance v. complexity --lots of "advice". some is literally advice; some is actually required practice in this class. --software safety (Therac-25) --scheduling --intro: when scheduling happens, which metrics, what costs --specific disciplines --lessons and conclusions --Now questions from you all......