Jump to content




too long w/o yeilding fix?


4 replies to this topic

#1 etopsirhc

  • Members
  • 122 posts

Posted 23 January 2013 - 07:58 AM

is their an easy way to make it not do this?
like someglobal variable i can change to skip that error check?

#2 ChunLing

  • Members
  • 2,027 posts

Posted 23 January 2013 - 08:06 AM

No, and even if there were you shouldn't. Yielding is vital because all the computers are being emulated in the same program...so the execution needs to advance one program at a time and then switch to another program to advance that. Yielding is the current means of accomplishing this.

The mod development team is working on making it so that the program on a computer doesn't have to yield, and will simply be interrupted in mid-execution to let other computers run their programs. But even when this feature is implemented, it will still be best practice to write your programs so that they yield, so as to run efficiently.

#3 etopsirhc

  • Members
  • 122 posts

Posted 23 January 2013 - 08:08 AM

so given that my program is a gaint turtle 3d printer , how do i make it yeild ? os.sleep() after so many moves or somthing?

#4 Willibilly19

  • Members
  • 48 posts
  • LocationColorado, USA

Posted 23 January 2013 - 08:11 AM

Don't need os.sleep(), just sleep() will work for ya.....so like add in sleep(1) in every now and then.

#5 ChunLing

  • Members
  • 2,027 posts

Posted 23 January 2013 - 08:30 AM

That's one way of doing it. Also, nearly all the normal turtle functions use os.pullEvent("turtle_response") If you've managed to bypass that somehow, then you should stop.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users