Zusammengesetzte Aktionen

check-then-act

Stack<Foo> l = ... ;
if (! l.empty()) { Foo x = l.pop (); ... }

read-modify-write

int x = ... ;   x = x + 1 ;

sind nicht atomar und damit nicht thread-sicher

Auswege:



Johannes Waldmann 2013-06-18