Here is a parallel computation involving precompute and append:
sage: L=[]
sage: @cached_function
....: def function(i):
....: print([i])
....: L.append(i)
....:
sage: function.precompute(range(10),num_processes=2)
[0]
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
The problem is that the list L is still empty, the action L.append(i)
was not done as expected.
sage: L
[]
How to solve this problem?