I have 2 target multiprocessing function and I have passed dictionary in them as argument but the data inside that is not changing after the functions completes. please help me regarding this. in simple words I want to pass dictionary as reference in multiprocessing functions.
code
if __name__ == '__main__':
all_repo_data = {} #this is that dictionary
repos_data = total_repo_fetch(data, total_repos)
fetch_repo_info(all_repo_data, repos_data, total_stars,)
f1 = multiprocessing.Process(target = total_commit_fetch,args = (all_repo_data,))
f3 = multiprocessing.Process(target=total_contributors, args=(all_repo_data,))
f1.start()
f3.start()
f3.join()
f1.join()
f1 function
def total_commit_fetch(all_repo_data):
#some work .....
#changing the value of all_repo_data dictionary....
all_repo_data[(repo)]['total_commits'] = total_commit
but after the function complete dictionary is same as before and 'total_commits' is not available and data is lost.