Hmm.. wasn&#39;t some kind of watchdog thing added to catch stuff like this:<div><br></div><div>while (true) {</div><div>}</div><div><br></div><div>...? That ought to catch Eduard&#39;s problem as well, I would think. Maybe it&#39;s some kind of option to the chuck application?</div>
<div><br></div><div>/Stefan<br><br><div class="gmail_quote">On Mon, Nov 10, 2008 at 1:05 PM, lucas samaruga <span dir="ltr">&lt;<a href="mailto:samarugalucas@gmail.com">samarugalucas@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Hello</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp; I think it&#39;s a logic problem, ChucK can&#39;t worry about everything. Other example,&nbsp;If you yiel two shereds in a particular way the time don&#39;t pass (I can&#39;t code it&nbsp;right now).<br>&nbsp;&nbsp;&nbsp; Maybe I&#39;m wrong...</div>


<div>&nbsp;</div>
<div>Cheers</div>
<div>Lucas<br>&nbsp;</div>
<div><span class="gmail_quote">2008/11/9, eduard aylon &lt;<a href="mailto:eduard.aylon@gmail.com" target="_blank">eduard.aylon@gmail.com</a>&gt;:</span><div><div></div><div class="Wj3C7c">
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:#ccc 1px solid">Sorry list for bombing you with so many questions, but got this funny one, which I thought would be interesting to post. The patch below loops endlessly although no while(true) loop exists in the &quot;main&quot;. If you try the patch, be warn that your computer may (or may not) become unresponsive. The code makes sense, and the behaviour as well, but should chuck throw a warning when something like this happens? I came up with this, while trying to have a process for reading and another for writing, but didn&#39;t want to advance time in any of them.<br>

<br>eduard<br><br>class mySpork<br>{<br>&nbsp;Event write;<br>&nbsp;Event read;<br><br>&nbsp;fun void start(){ read.signal(); &lt;&lt;&lt;&quot;started&quot;&gt;&gt;&gt;; }<br><br>&nbsp;fun void Write()<br>&nbsp;{<br>&nbsp; &nbsp;// NOTE: time is not advanced in this function<br>

&nbsp; &nbsp;while(true)<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp;write =&gt; now;<br>&nbsp; &nbsp; &nbsp;//&lt;&lt;&lt; &quot;writing&quot; &gt;&gt;&gt;;<br>&nbsp; &nbsp; &nbsp;read.signal();<br>&nbsp; &nbsp;}<br>&nbsp;}<br><br>&nbsp;fun void Read()<br>&nbsp;{<br>&nbsp; &nbsp;// NOTE: time is not advanced in this function<br>

&nbsp; &nbsp;while(true)<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp;read =&gt; now;<br>&nbsp; &nbsp; &nbsp;//&lt;&lt;&lt; &quot;reading&quot; &gt;&gt;&gt;;<br>&nbsp; &nbsp; &nbsp;write.signal();<br>&nbsp; &nbsp;}<br>&nbsp;}<br>}<br><br>mySpork myspork;<br>spork~myspork.Read();<br>spork~myspork.Write();<br>

me.yield();<br>myspork.start();<br>&lt;&lt;&lt; &quot;loops forever&quot;&gt;&gt;&gt;;<br>1::second =&gt; now;<br>&lt;&lt;&lt; &quot;and never gets here&quot;&gt;&gt;&gt;;<br><br>_______________________________________________<br>

chuck-users mailing list<br><a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a><br><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>

</blockquote></div></div></div><br>
<br>_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Release me, insect, or I will destroy the Cosmos!<br>
</div>