Home > Software engineering >  Terminate worker process and retrieve intermediate result from worker process based on the value of
Terminate worker process and retrieve intermediate result from worker process based on the value of

Time:02-10

I have a few worker processes for fitting models (running iterative improvement algorithms) and a main process listening to events, If certain events arrive, I will need to terminate the worker processes and retrieve their current model params from the worker process (before the fitting stops/converges)

My thought is to create a shared variable for event, like, setting its value to 1 if certain event happens, and 0 otherwise. So, when worker process checks its value equal to 1, it calls "terminate" in the worker process and return the models params.

This is all I could think of, does anyone have a better idea of how to approach this? Thank you very much!

CodePudding user response:

  •  Tags:  
  • Related