You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just figured out how to send ThreadKilled signals to all child threads. The use case is that we have lots of parallel threads that work on a database, and if they are killed they want to record that fact to the database before being destroyed. Since the child threads don't get notified if the main thread receives a user interrupt, I did something like this:
Without this, if the main thread dies, the child threads are just silenlty destroyed without having a chance to do anything about it (write the fact to a log file, roll back a transaction, ...). I suspect that many people have been forced to figure this out and implement it by hand, and it would be cool if it could be stashed away in parallel-io under the hood.
Questions:
(a) would a patch that does this implicitly be welcome?
(b) would it be done like in the code I just hacked together, or would you like to see it done differently?
(c) is there any concievable reason anybody would want to switch this feature off?
The text was updated successfully, but these errors were encountered:
Hi everybody,
I just figured out how to send ThreadKilled signals to all child threads. The use case is that we have lots of parallel threads that work on a database, and if they are killed they want to record that fact to the database before being destroyed. Since the child threads don't get notified if the main thread receives a user interrupt, I did something like this:
Without this, if the main thread dies, the child threads are just silenlty destroyed without having a chance to do anything about it (write the fact to a log file, roll back a transaction, ...). I suspect that many people have been forced to figure this out and implement it by hand, and it would be cool if it could be stashed away in parallel-io under the hood.
Questions:
(a) would a patch that does this implicitly be welcome?
(b) would it be done like in the code I just hacked together, or would you like to see it done differently?
(c) is there any concievable reason anybody would want to switch this feature off?
The text was updated successfully, but these errors were encountered: