26.08.2013 Views

3.1 MB - Evernote

3.1 MB - Evernote

3.1 MB - Evernote

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Parallel Transaction-oriented Simulation<br />

because this read access should happen at the simulation time 5 which is before the<br />

event e2 at LP1 overwrote the value of o1. Instead event e4 reads the value of o1 as it<br />

appears at the simulation time 12.<br />

LP1<br />

Current simulation time = 12<br />

Current event = e3<br />

e3 12, ...<br />

Object<br />

o1<br />

Event list Event list<br />

...<br />

e2 8, write o1<br />

e1 3, read o1<br />

...<br />

Future events<br />

Current event position<br />

Past events<br />

Figure 7: Accessing objects in other LPs<br />

LP2<br />

Current simulation time = 5<br />

Current event = e4<br />

e4 5, read o1<br />

Because accessing an object within another LP is an action that is linked to a specific<br />

point of simulation time it can also be viewed as an event according to the description of<br />

events in section 4.1.1. Like other events they have to be executed in the correct causal<br />

order. This means that event e4 that is reading the value of object o1 has to happen at the<br />

simulation time 5. Sending this event to LP1 would cause LP1 to roll back to the<br />

simulation time 5 so that e4 would read the correct value.<br />

Treating the access to objects as a special kind of event solves the problem mentioned<br />

above. Such a solution can also be applied to transaction-oriented simulation by<br />

implementing a simulation scheduler that besides Transactions can also handle these<br />

kinds of object access events. Alternatively the object access could be implemented as a<br />

pseudo Transaction that does not point to its next block but instead to an access method<br />

that when executed performs the object access and for a read access returns the value.<br />

Such a pseudo Transaction would send the value back to the originating LP and then be<br />

deleted. Depending on the synchronisation algorithm it can also be useful treat read and<br />

write access differently. If for instance an optimistic synchronisation algorithm is used<br />

that saves system states for possible required rollbacks then rollbacks as a result of<br />

23<br />

...<br />

...

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

Saved successfully!

Ooh no, something went wrong!