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.

5. An Ownership-based MOP for Expressing Concurrency Abstractions<br />

of primitives that need to be covered. However, if the number of primitives<br />

grows too large, this <strong>de</strong>sign can become cumbersome.<br />

An alternative solution to list all primitives in the form of prim* is to use a<br />

generic intercession handler similar to the one provi<strong>de</strong>d to handle all methods<br />

in a uniform way. Such a handler needs to enco<strong>de</strong> the primitive as a parameter,<br />

for instance like #requestPrim: prim on: obj with: arguments.<br />

Handling of Reified Execution State Since the presented implementations<br />

are based on Smalltalk, they have direct access to runtime state for instance<br />

to stack frames, i. e., context objects that are used for execution (cf. Sec. 4.2.2).<br />

Context objects, and similar objects relevant for execution semantics, need<br />

to be treated carefully. For each of them, it has to be <strong>de</strong>termined whether<br />

the notion of ownership should be provi<strong>de</strong>d or whether that would lead to<br />

unexpected consequences.<br />

In the case of some context object it is conceivable that it has an arbitrary<br />

owner and that it is treated like any other object. As long as it is merely<br />

used for introspection, it is feasible to allow arbitrary ownership changes and<br />

the enforcement of arbitrary domain semantics. However, if a context object<br />

is used by the VM for its purpose as a stack frame, neither the notion of<br />

ownership nor the enforcement of arbitrary domain semantics are viable. The<br />

VM needs direct access to them, for instance to perform the necessary stack<br />

operations during execution.<br />

T<strong>here</strong>fore, the implementations discussed in Chapter 7 regard context objects<br />

as metaobjects that are not subject to the OMOP.<br />

5.6. Related Work<br />

This section contrasts the proposed OMOP with other MOPs that cover closely<br />

related concerns or MOPs that have been used in the field of concurrent and<br />

parallel programming. As in Sec. 5.1, this section relies on the categorization<br />

of Tanter [2009] discussing metaclass-based, metaobject-based, as well<br />

as group-based hybrid approaches.<br />

Metaclass-based Approaches The C++ extensions Open C++ [Chiba and<br />

Masuda, 1993] and PC++ [Stroud and Wu, 1995], which is built on top of<br />

Open C++, both use metaclass-based MOPs. Open C++ is used in the context<br />

of distributed programming and Chiba and Masuda [1993] give examples on<br />

130

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

Saved successfully!

Ooh no, something went wrong!