Freitag, 13. März 2009

CS4282/CS6282 Internet and Distributed Systems Programming

CS4282/CS6282 Internet and Distributed Systems Programming

Doug Lea : Concurrent Programming in Java

notes on p.160

State-dependent action designs:

1. liveness-first design vs safety-first design

2. Optimisitc: try-and-see() methods can always be tried when invoked, but DO NOT always succed, and thus may have to deal with failure.

3. Conservative: check-and-act() methods REFUSE to proceed unless preconditions hold. When preconditions do hold, the actions always succeed.

4. Optimistic approaches rely on the existence of exceptions and related mechanism that indicate when postconditions DO NOT hold.

5. Conservative approaches rely on the avaliability of guard constructions that indicate when preconditions HOLD and guarantee that they continue to hold across the course of an action relying on them.



Keine Kommentare: