How can I send a value which in a process to another process? For example I have something like this code piece. I want to print value in xFunc. Can someone explain how can I do it? Thank you.
def yFunc():
value = 5
def xFunc():
print(value)
def smap(f):
return f()
def main():
f_x = functools.partial(xFunc)
f_y = functools.partial(yFunc)
with Pool() as pool:
res = pool.map(smap, [f_x, f_y])
if __name__ == '__main__':
main()
Edit: value is not constant number it is changing continuously.
Edit2: I found a way for my problem. Here the solution: