in reply to Correct code crashes ActivePerl Interpreter
[ Not related to the crash. ]
Your SIGINT handling seems a bit fishy. Do realise that signals are per process, not per thread? You tell the system the process should do something in response to SIGINT, but then you almost immediately go and tell the system the process should ignore SIGINT (until caluations are done).
This may be correct, but I think having one handler for SIGINT would be cleaner, and just change the behaviour of the handler based on the current state. For starters, your model would fail if you ran two instances of your calculation thread in parallel.
|
|---|