-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freezing loop #348
Comments
this correspondes to this code of mine:
that works fine in NetLogo Desktop |
I tried adding a "wait 0" in case it would help, but I get back "Error", "unimplemented primitive: wait" message. What other NOP-style command could I use inside that tight loop? |
btw, note that Firefox becomes unresponsive even if one presses Stop Script at the respective dialog. You have to press Debug script, then close the tab |
There is no such thing in JavaScript, which is a single-threaded environment. This problem is the same one that prevents This problem is on our radar and is something that we want to fix soon. However, solving these sorts of problems for NetLogo in a general way, in JavaScript, is not straightforward or easy. Closing as duplicate of NetLogo/Tortoise#151 . |
Indeed, had discussed this in the past and had forgotten about it. Would expect the whole netlogo program though to run on a background worker |
I see generated code of the following style:
that causes freezing of Firefox
The compiler should never generate such tight (with no code in them) loops I think if Javascript can't handle them. Should have some small sleep in there. In Java even sleep(0) worked to avoid freezing
The text was updated successfully, but these errors were encountered: