here - Stefan-Marr.de
here - Stefan-Marr.de
here - Stefan-Marr.de
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
3.3. Common Problems for the Implementation of Concurrency Abstractions<br />
minimal and does not provi<strong>de</strong> the flexibility required for multi-language VMs.<br />
For instance, the JVM relies on the problematic method setAccessible(bool),<br />
which needs to be called to disable the security checks to circumvent language<br />
restrictions. While setAccessible(bool) is covered by the SecurityManager<br />
and its handler can be customized with another security strategy, the object<br />
can be manipulated at will once obj.setAccessible(true) succee<strong>de</strong>d. 26<br />
Thus, enforcing complex policies is not possible with this approach. Another<br />
weak point is that the security infrastructure only consi<strong>de</strong>rs fields that are<br />
protected by Java language semantics. Thus, public fields of an object are not<br />
covered by the security manager, which t<strong>here</strong>fore cannot be used to express<br />
concurrency policies for all objects.<br />
Conclusion Reflection in the form it is supported on today’s VMs is not<br />
<strong>de</strong>signed to enable the required fine-grained control. Common approaches<br />
provi<strong>de</strong> only limited security-related mechanisms to restrict the reflective capabilities.<br />
However, the provi<strong>de</strong>d abstractions are not expressive enough to<br />
distinguish between different parts of a language. For instance, is not possible<br />
to freely use reflection on objects insi<strong>de</strong> of an actor to circumvent their private<br />
field restrictions, without risking to have concurrency issues with objects that<br />
belong to another actor, because the reflection would also circumvent these<br />
concurrency restrictions.<br />
Thus, reflection needs to provi<strong>de</strong> the ability to do metaprogramming with<br />
the possibility to circumvent only certain language restrictions, while adhering<br />
to other parts of the language, for instance concurrency-related semantics.<br />
3.3.6. Summary<br />
As argued in this section, the implementation of proper isolation, scheduling<br />
guarantees, and immutability is problematic with today’s VMs. For the implementation<br />
of isolation, language <strong>de</strong>signers have to make a tra<strong>de</strong>off between<br />
semantic guarantees, performance, and implementation complexity. To ensure<br />
progress in mo<strong>de</strong>ls such as actors or CSP, language <strong>de</strong>signers have to<br />
be able to rely on scheduling guarantees which are typically implemented on<br />
top of the VM, and thus, handling of computationally expensive or blocking<br />
operations un<strong>de</strong>rmines the required guarantees.<br />
Immutability also requires proper enforcement to yield its full engineering<br />
benefit, especially in the setting of a multi-language VM for concurrent<br />
26 http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/reflect/Field.html#set<br />
(java.lang.Object,java.lang.Object)<br />
81