chrisjbillington / zprocess

A collection of utilities for multiprocessing using zeromq.
BSD 2-Clause "Simplified" License
2 stars 5 forks source link

Exiting Processes gracefully #5

Closed chrisjbillington closed 5 years ago

chrisjbillington commented 6 years ago

Original report by Jan Werkmann (Bitbucket: 557058:a70cc9cf-684e-4849-a61a-9ade4d7218b5, GitHub: PhyNerd).


I ran into some problems on windows where processes would not release locks when they are being terminated.

For unix systems there is always the option to use Python's singal library and connecting signal.SIGTERM to some callback function that cleanly exists the process. For windows terminate() calls the windows api's TerminateProcess which triggers no signal at all.

The Process class should provide a shutdown function, that gets called upon terminating a process to ensure graceful termination.

chrisjbillington commented 5 years ago

Process() supports terminate(), so closing this as fixed.