Skip to content
Discussion options

You must be logged in to vote

You could use a shared global variable, say STOP = False. In the main thread, trap KeyboardInterrupt and set STOP = True. On the second core, periodically check the variable. In fact it might be worth trapping any exception and setting STOP = True:

STOP = False
try:
    run_my_application()
except:  # ctrl-c or program error
    STOP = True

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jimmo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants