COMP 409 Lecture Notes - Lecture 12: Posix Threads, Partially Ordered Set, Sequential Consistency

61 views6 pages

Document Summary

P0 x = 2 x = 1 ebx = x (1) eax = x (2) eax = 2 ebx = 1. Useful in optimizing a spin-lock in linux kernel. Spinlock: address of lock in eax, start: lock: dec[eax] Jmp start: exit: mov[eax], 1 enter() x = y y = x exit() Memory models: x86-tso, visibility of write operations. Java virtual machine: multithreaded, needs a memory model d jump no sign (succeeds when going from 1 to 0) It implied coherence (slightly stronger: timeline for every variable. Current memory model: balance programmability (strong) and ability to optimize (weak, define program as two classes, correctly synchronized, no data races, assume sequential consistency, incorrectly synchronized, there exists a data race, should have some semantics (complex) For all cases: happens-before consistency (hb-consistency, based on runtime traces, post-mortem analysis, 2 orders. Intra-thread order (program order, normal ordering of program)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers