nice each process has a niceness batch job managers few if any interrupts Threads are easier than process Thread: program registers, PC, flags Process: all of that, and MMU, permissions, ... Hyperthreading, virtual cores 1 core will have 2 copies of all registers, can run 2 threads in parallel means: OS knows thread ≠ process -------------------------------------------------- 2 threads access same memory 2 identical threads, both run 1-assembly instruction function: addq $1, (%rax) assume both share %rax = 0x12340000 assume before either thread runs, (%rax) = 0 a. 2 40% b. 1 60% c. 0 0 d. 3 0 e. other 3 f. depends; could be 1 or 2; depends on runtime randomness g. depends; 2 if done one after the other, 1 otherwise 1 1 0 0 0 0 Core1 L1 L2 L3 L4 RAM Core2 L1 1 1 1 Atomicity Atomic = cannot be divided 1 1 0 0 0 0 Core1T1 L1 L2 L3 L4 RAM Core1T2 1 1 Race conditions after a process ends, it is still there: it is a zombie