Design and Implementation of TinyGALS: A Programming Model for ...
Design and Implementation of TinyGALS: A Programming Model for ...
Design and Implementation of TinyGALS: A Programming Model for ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
pull() method <strong>of</strong> Null calls pull() on its input port, which calls the pull() method<br />
<strong>of</strong> the Queue. The Queue element dequeues the packet <strong>and</strong> returns it through the return <strong>of</strong><br />
the pull() calls.<br />
Overhead in Click Modularity in Click results in two main sources <strong>of</strong> overhead. The first<br />
source <strong>of</strong> overhead comes from passing packets between elements. This causes one or two<br />
virtual function calls, which involves loading the relevant function pointer from a virtual<br />
function table, as well as an indirect jump through that function pointer. This overhead is<br />
avoidable – the Click distribution contains a tool to eliminate all virtual function calls from<br />
a Click configuration. The second source <strong>of</strong> overhead comes from unnecessarily general<br />
element code. The authors <strong>of</strong> [25] found that element generality had a relatively small<br />
effect on Click’s per<strong>for</strong>mance since not many elements in a particular configuration <strong>of</strong>fered<br />
much opportunity <strong>for</strong> specialization.<br />
Comparison <strong>of</strong> Click to <strong>TinyGALS</strong> An element in Click is comparable to a component<br />
in <strong>TinyGALS</strong> in the sense that both are objects with private state. Rules in Click on con-<br />
necting elements together are similar to those <strong>for</strong> connecting components in <strong>TinyGALS</strong><br />
– push outputs must be connected exactly once, but push inputs may be connected more<br />
than once (see Sections 2.3.3 <strong>and</strong> 3). Both types <strong>of</strong> objects (Click elements <strong>and</strong> <strong>TinyGALS</strong><br />
components) communicate with other objects via method calls. In Click, there is no funda-<br />
mental difference between push processing <strong>and</strong> pull processing in Click at the method call<br />
level <strong>of</strong> view; they are sets <strong>of</strong> method calls that differ only in name. However, the direction<br />
<strong>of</strong> control flow with respect to data flow in the two types <strong>of</strong> processing are opposite <strong>of</strong><br />
each other. Push processing can be thought <strong>of</strong> as event-driven computation (if we ignore<br />
the polling aspect <strong>of</strong> Click), where control <strong>and</strong> data flow downstream in response to an<br />
upstream event. Pull processing can be thought <strong>of</strong> as dem<strong>and</strong>-driven computation, where<br />
control flows upstream in order to compute data needed downstream.<br />
Figure 24 helps to provide a more detailed analysis <strong>of</strong> the difference in control <strong>and</strong> data<br />
51