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.

3.1. VM Support for Concurrent and Parallel Programming<br />

In Self, the functionality is implemented completely in libraries. The VM<br />

provi<strong>de</strong>s only preemptive green threads and the so-called TWAINS_prim primitive.<br />

This provi<strong>de</strong>s sufficient VM support to build scheduling, semaphores,<br />

and other abstractions on top.<br />

3.1.2.2. Communicating Threads (ComT)<br />

Similarly to Threads and Locks, the Communicating Threads-based mo<strong>de</strong>ls offer<br />

shared memory and come with the notion of threads as a means of execution.<br />

However, they offer approaches to communicate between threads that<br />

are distinct from approaches that rely on locks for correctness. For instance,<br />

channel-based communication has software engineering tra<strong>de</strong>offs different<br />

from the use of locks.<br />

Dis VM The Dis VM [Lucent Technologies Inc and Vita Nuova Limited,<br />

2003] is part of the Inferno OS and hosts the Limbo programming language.<br />

Since the source co<strong>de</strong> does not seem to be available, the analysis relies solely<br />

on the specification and manuals.<br />

Limbo, and consequently the Dis VM are strongly inspired by Hoare’s CSP<br />

(cf. Sec. 2.4.4). However, Limbo and the Dis VM provi<strong>de</strong> the notion of shared<br />

mutable memory between threads and do not follow the notion of isolated<br />

processes as proposed by CSP.<br />

The instruction set of the Dis VM provi<strong>de</strong>s operations to mutate shared<br />

memory, spawn threads, and use channel-based communication with sending<br />

and receiving. Since the Dis VM uses a memory-to-memory instruction<br />

set architecture, instead of relying on registers, most operations mutate heap<br />

memory. While threads are available, t<strong>here</strong> are no locking-like primitives or<br />

instructions available. Instead the send, recv, and alt channel operations are<br />

the only instructions in the specification that provi<strong>de</strong> synchronization.<br />

Nevertheless, the Limbo language manual <strong>de</strong>monstrates how monitors can<br />

be built on top of channels.<br />

Glasgow Haskell Compiler The Glasgow Haskell Compiler (GHC) was one<br />

of the first language implementations to inclu<strong>de</strong> a software transactional<br />

memory (STM) system in its standard distribution. While Haskell is <strong>de</strong>signed<br />

as a si<strong>de</strong>-effect free language with lazy execution semantics, its monadic-style<br />

can be used in an imperative way, which makes it necessary to coordinate<br />

si<strong>de</strong>-effects when parallel execution is used. To that end, GHC introduced<br />

49

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

Saved successfully!

Ooh no, something went wrong!