while (true) {} Problem

Is there a way to use 'while (true) {};' without causing it to hang? I need to continuously change and send model images and parameters to Python for processing while the script is running. However, I'm not sure how to make it possible using this method. If waiting for the script to complete its task is necessary,

Comments

  • If you don't give the loop an exit condition it will cycle ebdlessly, and only events inised the loop will be processed. You might, for example, use a variable set to true instead of the explicit value - then, when conditions are right, the code in the loop can set the variable to false and the loop will terminate. Potentially infinite loops should be avoided where possible.

Sign In or Register to comment.