I have looked at other posts but I still don't know how to set an object attribute inside a multiprocessing pool.
It works when I use threading but not with multiprocessing, and I don't know how to include the Manager object in my code. When I try I obtain the same result as if I did not use it.
def protein_object_creator_pooled(protein_dict):
tissue = protein_dict['tissue']
protein_object_list = []
for hpa_protein in protein_dict['protein']:
protein_object_list.append(t.Tissue.protein_object_list_creator(hpa_protein))
tissue.protein_object_list = protein_object_list
This is the function I pool with
pool.map(self.protein_object_creator_pooled, top_hpa_protein_dict_list)
Only works (adds the "protein_object_list" attribute to the tissue element when I use ThreadPool, not Pool).