03.08.2013 Views

Dynamic Dataflow Modeling in Ptolemy II - Ptolemy Project ...

Dynamic Dataflow Modeling in Ptolemy II - Ptolemy Project ...

Dynamic Dataflow Modeling in Ptolemy II - Ptolemy Project ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

course if there are more than one output channel satisfy<strong>in</strong>g dest<strong>in</strong>ation actors, the actor is<br />

still deferrable. However, it does not require that all output channels satisfy all<br />

dest<strong>in</strong>ations actors to be a deferrable actor. Second, when one particular channel of a<br />

dest<strong>in</strong>ation actor is satisfied, it has two possible situations. One situation is that the<br />

number of tokens buffered on that channel is greater than or equal to the number of<br />

tokens required on that channel <strong>in</strong> order to fire the dest<strong>in</strong>ation actor. Another situation is<br />

that the dest<strong>in</strong>ation actor does not consume a token on that channel dur<strong>in</strong>g next fir<strong>in</strong>g.<br />

Third, when one particular channel of a dest<strong>in</strong>ation actor is satisfied, it does not mean the<br />

dest<strong>in</strong>ation actor is enabled. It may be still wait<strong>in</strong>g for tokens on different channels to<br />

enable the next fir<strong>in</strong>g. The consequence is that we cannot use the prefire() method of the<br />

dest<strong>in</strong>ation actors to check its deferability. Each actor must expose the number of tokens<br />

consumed on each <strong>in</strong>put channel as part of its <strong>in</strong>terface, which may dynamically change<br />

from one fir<strong>in</strong>g to another. This will have consequences <strong>in</strong> design<strong>in</strong>g actors that can be<br />

used <strong>in</strong> DDF doma<strong>in</strong>.<br />

Hav<strong>in</strong>g def<strong>in</strong>ed the deferability of an actor, which is a key concept <strong>in</strong> our scheduler, we<br />

now give the algorithm <strong>in</strong> the follow<strong>in</strong>g pseudo-code:<br />

At the start of each basic iteration compute {<br />

E = set of enabled actors<br />

D = set of deferrable and enabled actors<br />

m<strong>in</strong>imax(D) = subset of D as def<strong>in</strong>ed on the next page<br />

}<br />

One basic (default) iteration consists of {<br />

If (E \ D != Ø)<br />

fire (E \ D)<br />

else if (D != Ø)<br />

fire m<strong>in</strong>imax(D)<br />

else<br />

declare deadlock<br />

}<br />

26

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

Saved successfully!

Ooh no, something went wrong!