<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">From <a href="http://timber-lang.org">timber-lang.org</a> &gt;&gt; Language summary &gt;&gt; Time constructs:<div class=""><br class=""></div><div class=""><span style="font-family: times, 'times new roman', georgia, serif; font-size: 16px; " class="Apple-style-span"><p style="font-size: 1em; width: 37em; " class="">Time windows of reactions are assigned as follows:</p><ul style="font-size: 1em; width: 35em; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; " class=""><li style="font-size: 1em; ">The time window of a reaction to an external event has as baseline the time instant when the event occurs, and as deadline an idealised instant infinitely far into the future.<p style="font-size: 1em; width: 37em; " class="">In particular, the start action of a program gets as baseline the time instant when program execution begins.</p></li><li style="font-size: 1em; margin-top: 1em; "><p style="font-size: 1em; width: 37em; " class="">When a message without time constraints is sent (i.e., an plain action is called) from a method with current baseline&nbsp;<em style="font-size: 1em; " class="">bl</em>&nbsp;and deadline&nbsp;<em style="font-size: 1em; " class="">dl</em>, the reaction to the message inherits both&nbsp;<em style="font-size: 1em; " class="">bl</em>&nbsp;and&nbsp;<em style="font-size: 1em; " class="">dl</em>.</p></li><li style="font-size: 1em; margin-top: 1em; "><p style="font-size: 1em; width: 37em; " class="">The rule in the previous item can be changed by explicit program constructs:</p><ul style="font-size: 1em; width: 35em; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; " class=""><li style="font-size: 1em; "><p style="font-size: 1em; width: 37em; " class="">The expression&nbsp;<tt style="margin-top: 3px; margin-right: 3px; margin-bottom: 3px; margin-left: 3px; " class="">after</tt>&nbsp;<em style="font-size: 1em; " class="">t</em>&nbsp;<em style="font-size: 1em; " class="">act</em>&nbsp;sets the effective baseline for&nbsp;<em style="font-size: 1em; " class="">act</em>&nbsp;to the current baseline plus&nbsp;<em style="font-size: 1em; " class="">t</em>.</p></li><li style="font-size: 1em; margin-top: 1em; "><p style="font-size: 1em; width: 37em; " class="">The expression&nbsp;<tt style="margin-top: 3px; margin-right: 3px; margin-bottom: 3px; margin-left: 3px; " class="">before</tt>&nbsp;<em style="font-size: 1em; " class="">t</em>&nbsp;<em style="font-size: 1em; " class="">act</em>&nbsp;sets the effective deadline for&nbsp;<em style="font-size: 1em; " class="">act</em>&nbsp;to its effective baseline plus<em style="font-size: 1em; " class="">t</em>.</p></li></ul></li>In both cases,&nbsp;<em style="font-size: 1em; " class="">act</em>&nbsp;can be any expression of type&nbsp;<tt style="margin-top: 3px; margin-right: 3px; margin-bottom: 3px; margin-left: 3px; " class="">Action</tt>, which includes the time-annotated constructs just introduced. Nested baseline offsets are composed using addition, while multiple deadline offsets are resolved by selecting the minimal value. The relative order of&nbsp;<tt style="margin-top: 3px; margin-right: 3px; margin-bottom: 3px; margin-left: 3px; " class="">after</tt>&nbsp;and&nbsp;<tt style="margin-top: 3px; margin-right: 3px; margin-bottom: 3px; margin-left: 3px; " class="">before</tt>&nbsp;constructs is not relevant.<p style="font-size: 1em; width: 37em; " class=""><b><br></b></p><p style="font-size: 1em; width: 37em; " class=""><b class="">Special case: if the baseline denoted by an&nbsp;</b><tt style="margin-top: 3px; margin-right: 3px; margin-bottom: 3px; margin-left: 3px; " class=""><b class="">after</b></tt><b class="">&nbsp;construct is an already passed time instant, the effective baseline of the reaction is rounded off to the actual time of the call.</b></p></ul></span><div class="">Regards,</div><div class="">Andrey</div></div><div class=""><br class=""><div><div class="">On Oct 26, 2009, at 10:01, Ivan Tarasov wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="">I'm trying to understand what constitutes an RTS and how a Timber<br class="">program translated into C is actually executed. So, I'm reading the<br class="">RTS implementations' code.<br class=""><br class="">In rtsARM/rts.c, in ASYNC implementation, lines 439-442 we can see the<br class="">following code:<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (LESS(m-&gt;baseline, now)) {<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m-&gt;baseline = now;<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// debug("^");<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br class="">Same code is present in ASYNC implementation in rtsPOSIX/rts.c, lines 354-355<br class=""><br class="">That means that if the absolute time value for the baseline for the<br class="">action to be scheduled is in the past, we set the baseline to the<br class="">current time. However, since all the time calculations are relative to<br class="">the baseline, that would mean that all the following actions to be<br class="">scheduled from the one being scheduled at the moment would "drift". Is<br class="">this an intended behavior? I'm not sure that's the right decision.<br class=""><br class="">Ivan<br class="">_______________________________________________<br class="">Timber mailing list<br class=""><a href="mailto:Timber@haskell.org">Timber@haskell.org</a><br class="">http://www.haskell.org/mailman/listinfo/timber<br class=""></div></blockquote></div><br class=""><div>
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; " class="Apple-style-span"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; " class="Apple-style-span"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; " class="Apple-style-span"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; " class="Apple-style-span"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; " class="Apple-style-span"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; " class="Apple-style-span"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><div class="">------------------------------------------------------------------------</div><div class="">Andrey Kruglyak</div><div class="">PhD student</div><div class=""><br class=""></div><div class=""><a href="http://www.andreykruglyak.com">http://www.andreykruglyak.com</a></div><div class=""><br class=""></div><div class="">Dept. of Computer Science and Electrical Engineering</div><div class="">Lulea University of Technology,&nbsp;Lulea, Sweden</div>T +46 920 49 23 57 (office)<div class="">T +46 706 16 76 03 (mobile)</div><div class="">Office A2314 (A-huset)</div></div></div></div></div></span></div></span></div></span></div></span></div></span></span></div></div></body></html>