In SageMath, I've seen at least two cases of the following issue. We have a function that constructs and returns elements from the same class, and it works as expected when it's called sequentially. However, when this function is called in parallel via multiprocessing functionality, the returned elements happen to come from different instances of the underlying class.
A recent example is described in SageMath's issue #37278. And another one is described at ask.sagemath.org.
Not every class fails this way under multiprocessing, some remain "stable" no matter whether the elements are constructed sequentially or in parallel. From issue #37278 linked above, SageMath's Permutations class is stable, while PermutationGroup class is not. It seems that those that are unstable miss something is their definition.
Q: What is the fundamental property of a class that makes it stable under the use of
multiprocessing?