Calling yield()
from within the loop is the generally recommended option for this. It’s not a 100% guarantee as I understand it, but makes it much more likely that the interrupt comes through. See for eg.
I’m currently working on a model that somehow get’s in a solving loop that I can’t cancel with Ctrl+C. To prove this I’m printing to the console from within the while loop that is running away. I can see the print statement reporting the ever increasing index to the console, but my keyboard input of Ctrl+C is ignored. Is there another way to interrupt Julia? My only solution at the moment is to kill Julia, but this is not ideal since I need to spend minutes re-compiling the current project.
Hi all,
I am learning to create an Interruptible routine for my camera sensor. My goal is to run an image acquisition routine on a remote process so that the local process can receive command from the user to perform other tasks. I start with this simple example. The routine creates a file, opens it and writes something into it at a certain period as shown below (Please note that the code in the while loop can be anything, I picked writing to a file as an example)
@everywhere function worker_f…
Ctrl+c fails to interrupt many functions. What makes a function interruptible?
1 Like