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.

5.2. Design of the OMOP<br />

set of mechanisms satisfies the ownership requirement and provi<strong>de</strong>s<br />

a way to adapt language behavior on an object level.<br />

By requiring that all objects have an owner it becomes possible to adapt<br />

language behavior in a uniform way for all objects in the system. For<br />

instance, domain objects themselves are owned by a domain. In the normal<br />

case it is a standard domain that represents the language behavior<br />

of the language implemented by the VM.<br />

Thread is the unit of execution. The enforced bit indicates whether it executes<br />

enforcing the semantics of domains, i. e., whether the intercession<br />

handlers are triggered or not. Each thread is said to run in the context<br />

of one specific domain. If a thread attempts to resume execution in a domain,<br />

the corresponding #requestThreadResume: intercession handler<br />

can be used to implement custom policies, for instance to prevent execution<br />

of more than one thread at a time. #evaluateEnforced: enables<br />

an existing thread to change the execution domain for the duration of<br />

the execution of the block. During the evaluation, guarantees are enforced,<br />

i. e., the corresponding flag in the thread is set. #spawnHere:<br />

creates a new thread in the given domain and starts its execution, iff<br />

#requestThreadResume has not specified a contradicting policy. These<br />

mechanisms are necessary to satisfy the managed execution requirement.<br />

Method representations can contain an additional bit to indicate that a particular<br />

method is always to be executed in the unenforced mo<strong>de</strong>. This<br />

gives more flexibility to control enforcement. If the bit is set, the<br />

thread executing the method will switch to execute in unenforced mo<strong>de</strong>,<br />

i. e., at the meta level. If the bit is not set, the thread will maintain the<br />

current execution mo<strong>de</strong>.<br />

Read/Write operations of object fields are <strong>de</strong>legated to the #readField:of:<br />

and #write:toField:of: intercession handlers of the owning domain.<br />

The domain can then <strong>de</strong>ci<strong>de</strong> based on the given object and the field<br />

in<strong>de</strong>x, as well as other execution state, what action needs to be taken.<br />

This satisfies the managed state requirement. Note, the intercession<br />

handlers are only triggered while the thread executes in the enforced<br />

execution mo<strong>de</strong>.<br />

Method Execution is represented by the #requestExecOf:on:with:lkup: intercession<br />

handler. It enables the domain to specify language behavior<br />

117

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

Saved successfully!

Ooh no, something went wrong!