05.08.2014 Views

here - Stefan-Marr.de

here - Stefan-Marr.de

here - Stefan-Marr.de

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

1 STMDomain = Domain ( | processes |<br />

2 readField : idx of: obj = unenforced (<br />

3 ^ obj workingCopy instVarAt : idx )<br />

4<br />

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

6 ^ obj workingCopy instVarAt : idx put : val )<br />

7<br />

8 primat : idx on: obj = unenforced (<br />

9 ^ obj workingCopy at: idx )<br />

10<br />

11 primat : idx put : val on: obj = unenforced (<br />

12 ^ obj workingCopy at: idx put : val )<br />

13<br />

14 priminstVarAt : idx on: obj = unenforced (<br />

15 ^ obj workingCopy instVarAt : idx )<br />

16<br />

17 priminstVarAt : idx put : val on: obj = unenforced (<br />

18 ^ obj workingCopy instVarAt : idx put : val )<br />

19<br />

20 primNext : stream put : val = unenforced (<br />

21 ^ self evaluateEnforced : [ stream noprimNextPut : val ] )<br />

22<br />

23 " ... and all other primitives that access state ... "<br />

24<br />

25 requestThreadResume : process = unenforced (<br />

26 processes add : process .<br />

27 ^ process resume )<br />

28<br />

29 initialize = ( processes := WeakI<strong>de</strong>ntitySet new )<br />

30<br />

31 stopTheWorldExcept : proc = (<br />

32 ( processes copyWithout : proc ) do: [: each | proc suspend ] )<br />

33<br />

34 resumeTheWorldExcept : proc = (<br />

35 ( processes copyWithout : proc ) do: [: each | proc resume ] ) )<br />

Listing 6.5: Definition of a Domain for an STM<br />

152

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

Saved successfully!

Ooh no, something went wrong!