Parallel execution in COS
Hello community,
I need to perform some processing-heavy operations on a set of input objects and I would like to utilize more than a single processor core to do the heavy lifting.
Is there any way to call methods in parallel and wait for the results in a blocking way?
Basically, I am looking for an equivalent of the pythonese
with Pool(n) as p:
results = p.map(function, data)
Thanks
Jiri
EDIT: Correct English :)
Comments
take a look to class %SYSTEM.WorkMgr.
I think this could match your description.
http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25SYSTEM.WorkMgr
Hi, Jiri!
See also the related series on Map-Reduce implementation (part1, part2, part3 in Caché by @Timur Safin .
Thanks for all the responses, it turned out Robert Cemper's solution fit my needs perfectly.
Hi, Jiry!
See also the sample on WorkMgr by @Alberto Fuentes .