Shared data across python-actions

Skip to first unread message

Tom Varga

Jan 14, 2022, 10:08:34 PMJan 14
to python-doit
I'm trying to summarize total cpu runtimes across all python-actions, especially when they're being run in parallel.
I was hoping to have each python-action update a variable in the Globals class by adding its runtime to the running total.
This seems to work fine if I set the 'par_type' option to 'thread'
Perhaps not unexpectedly, this doesn't work if it's set to 'process' (multiprocessing).
After some googling, it appears that I might be able to use the multiprocessing.share_memory module that's become available in 3.8.
However, before I go down that path, I'm wondering if anybody has a better suggestion?
Might it be possible to return some extra information from the python-action and collect it somehow at the top-level?
Reply all
Reply to author
0 new messages