Hmm.. wasn'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's problem as well, I would think. Maybe it'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"><<a href="mailto:samarugalucas@gmail.com">samarugalucas@gmail.com</a>></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> </div>
<div> I think it's a logic problem, ChucK can't worry about everything. Other example, If you yiel two shereds in a particular way the time don't pass (I can't code it right now).<br> Maybe I'm wrong...</div>
<div> </div>
<div>Cheers</div>
<div>Lucas<br> </div>
<div><span class="gmail_quote">2008/11/9, eduard aylon <<a href="mailto:eduard.aylon@gmail.com" target="_blank">eduard.aylon@gmail.com</a>>:</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 "main". 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't want to advance time in any of them.<br>
<br>eduard<br><br>class mySpork<br>{<br> Event write;<br> Event read;<br><br> fun void start(){ read.signal(); <<<"started">>>; }<br><br> fun void Write()<br> {<br> // NOTE: time is not advanced in this function<br>
while(true)<br> {<br> write => now;<br> //<<< "writing" >>>;<br> read.signal();<br> }<br> }<br><br> fun void Read()<br> {<br> // NOTE: time is not advanced in this function<br>
while(true)<br> {<br> read => now;<br> //<<< "reading" >>>;<br> write.signal();<br> }<br> }<br>}<br><br>mySpork myspork;<br>spork~myspork.Read();<br>spork~myspork.Write();<br>
me.yield();<br>myspork.start();<br><<< "loops forever">>>;<br>1::second => now;<br><<< "and never gets here">>>;<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>