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 ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
The BLESS_Send module is comprised <strong>of</strong> two components, one <strong>for</strong> re<strong>for</strong>matting mes-<br />
sages, Send Message, <strong>and</strong> the second <strong>for</strong> sending messages over the radio, Generic Comm.<br />
No global variables are used.<br />
Table 4 shows the sizes <strong>of</strong> the redesigned BLESS implementation, as well as the orig-<br />
inal BLESS implementation. For fair comparison, we only account <strong>for</strong> the sizes <strong>of</strong> the<br />
components inside <strong>of</strong> the modules. The last row <strong>of</strong> the table shows the total application<br />
sizes <strong>for</strong> two implementations <strong>of</strong> a target counting application which uses each BLESS<br />
implementation.<br />
From the table, we can deduce that 1170 (3366 - 2196 = 1170) additional bytes <strong>of</strong> code<br />
appear in the redesigned BLESS implementation. This difference is a 53.28% (1170/2196)<br />
increase in code size from the original implementation. However, this difference con-<br />
tributes only 9.156% (1170/12778) to the total code size <strong>of</strong> the new application. Tiny-<br />
GALS sacrifices some space in memory <strong>for</strong> improved s<strong>of</strong>tware modularity <strong>and</strong> code reuse.<br />
Applications that would take one week to implement now take us only 3 days to implement.<br />
In the above example, the BLESS_Send module is conveniently used by both <strong>of</strong> the<br />
other two modules to send the specialized router message. Additionally, we avoid poten-<br />
tial problems with shared state <strong>and</strong> interrupts through the use <strong>of</strong> TinyGUYS global vari-<br />
ables. TinyGUYS simplifies the code writing <strong>and</strong> debugging process by eliminating the<br />
need <strong>for</strong> explicit locks. <strong>TinyGALS</strong> also provides easy management <strong>of</strong> message queues. In<br />
the <strong>TinyGALS</strong> architecture <strong>of</strong> the above example, when a message is to be sent through<br />
Send Message, a request is queued at the input port to the BLESS_Send module.<br />
When processing time is available, BLESS_Send will run after dequeuing the messages<br />
from its input port. This same call in the existing TinyOS implementation would result<br />
in the message being sent immediately, or, if busy, not at all, due to its usage <strong>of</strong> a single<br />
pending lock. Use <strong>of</strong> the <strong>TinyGALS</strong> programming model leads to programs with better<br />
code structure <strong>and</strong> improved communication network reliability.<br />
41