05.08.2014 Views

here - Stefan-Marr.de

here - Stefan-Marr.de

here - Stefan-Marr.de

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6. Evaluation: The OMOP as a Unifying Substrate<br />

1 ImmutableDomain = Domain (<br />

2<br />

3 raiseImmutabilityError = (<br />

4 ImmutabilityError signal : ’ Modification of object <strong>de</strong>nied .’ )<br />

5<br />

6 write : val toField : idx of: obj = unenforced (<br />

7 self raiseImmutabilityError . )<br />

8<br />

9 primat : idx put : aVal on: anObj = unenforced (<br />

10 self raiseImmutabilityError . )<br />

11<br />

12 priminstVarAt : idx put : aVal on: anObj = unenforced (<br />

13 self raiseImmutabilityError . )<br />

14<br />

15 " ... and all other mutating operations "<br />

16 )<br />

Listing 6.3: Definition of a Domain for Immutable Objects<br />

6.2.2. Software Transactional Memory<br />

Introduction Software Transactional Memory (STM) (cf. Sec. 2.4.3) promises<br />

a solution to the engineering problems of threads and locks. This programming<br />

mo<strong>de</strong>l enables a programmer to reason about all co<strong>de</strong> as if it were executed<br />

in some sequential or<strong>de</strong>r. The runtime tries however to execute threads<br />

in parallel while giving the strong correctness guarantees implied by ensuring<br />

sequential semantics. While common consensus [Cascaval et al., 2008] seems<br />

to be that the performance overhead of STM systems is too high for many<br />

practical applications, the i<strong>de</strong>a continues to be appealing. 4 Thus, it is used as<br />

one of the case studies.<br />

This evaluation uses LRSTM (Lukas Renggli’s STM), which is based on<br />

the implementation <strong>de</strong>scribed by Renggli and Nierstrasz [2007] (cf. Sec. 7.1.3).<br />

The ad hoc version of LRSTM is a port of the original implementation to the<br />

current version of Squeak and Pharo. It uses the original approach, i. e., it<br />

uses abstract syntax tree (AST) transformation to add the tracking of state<br />

access and to adapt the use of primitives to enable full state access tracking.<br />

The implementation <strong>de</strong>tails are discussed below.<br />

4 The performance of an STM <strong>de</strong>pends also on the programming language it is applied to.<br />

Languages such as Haskell and Clojure restrict mutation and t<strong>here</strong>by experience lower<br />

overhead from an STM than imperative languages with unrestricted mutation, w<strong>here</strong> the<br />

STM needs to track all state access.<br />

148

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!