Presentation is loading. Please wait.

Presentation is loading. Please wait.

We should define semantics for languages, not for TM Tim Harris (MSR Cambridge)

Similar presentations


Presentation on theme: "We should define semantics for languages, not for TM Tim Harris (MSR Cambridge)"— Presentation transcript:

1 We should define semantics for languages, not for TM Tim Harris (MSR Cambridge)

2 The main argument Language implementation Program Threads, atomic blocks, retry, OrElse TM StartTx, CommitTx, ReadTx, WriteTx H/W Read, Write, CAS We should focus on defining this programmer-visible interface, rather than the internal interface used by the language implementation

3 An analogy Language implementation Program Garbage collected “infinite” memory GC Low-level, broad, platform-specific API, no canonical def. H/W

4 How: strong semantics for race-free programs Strong semantics: simple interleaved model of multi- threaded execution T 12345 Thread 4 in an atomic block Data race: concurrent accesses to the same location, at least one a write Race-free: no data races (under strong semantics) Write(x)

5 Implementation 1: “classical” atomic blocks on TM Language implementation Program Threads, atomic blocks, retry, OrElse Strong TM Strong TM Simple transformation Lazy update, opacity, ordering guarantees... H/W

6 Language implementation Program Threads, atomic blocks, retry, OrElse StartTx, CommitTx, ValidateTx, ReadTx(addr)->val, WriteTx(addr, val) Implementation 2: very weak TM Very weak STM No: –Guarantee that reads see a consistent view of memory –Guarantee that reads/writes don’t “spill over” to adjacent memory –Detection of tx/non-tx conflicts –Publication/privatization safety Yes: –Strict serializability in a tx-only workload Sandboxing for zombies Isolation of tx via MMU Program analyses GC support H/W

7 Implementation 3: lock inference Language implementation Program Threads, atomic blocks, retry, OrElse Locks Lock, unlock Lock inference analysis H/W

8 Define semantics for languages, not for TM We should focus on the interface between the language and the programmer –Define it without talking about tx –Permit a range of tx and non-tx implementations In a high-perf implementation, it is hard to cleanly separate the TM from other components –Interface is likely to be broad, platform-specific, and may appear weaker than the language constructs


Download ppt "We should define semantics for languages, not for TM Tim Harris (MSR Cambridge)"

Similar presentations


Ads by Google