I'm a little lost in trying to use the multiprocessing module. I have a simple nested loop to do some copying of attributes from one object to another:
if objects:
rb_from = obj_act.rigid_body
# copy settings
for o in objects:
rb_to = o.rigid_body
if o == obj_act:
continue
for attr in self._attrs:
setattr(rb_to, attr, getattr(rb_from, attr))
If nothing else, I'd like to parallelize the inner loop, but it's not clear to me how to do that. Most of the examples here focus on using the map function of multiprocessing, but I don't really care about the return value from setattr, I just want those calls to execute in parallel.