1 | initial version |
With
s1=Singular()
s2=Singular()
you get two different singular interfaces. Each has its own state. Sage does make some effort to hide the importance of state and just let you get on with wrapped objects, but behind the scenes there's a lot of state management (changing rings etc.)
2 | No.2 Revision |
With
s1=Singular()
s2=Singular()
you get two different singular interfaces. Each has its own state. Sage does make some effort to hide the importance of state and just let you get on with wrapped objects, but behind the scenes there's a lot of state management (changing rings etc.)
If your program has any kind of parallelism then you need to be make sure that at any time, there is only one thread/process communicating with a particular singular interface instance. So either you need some semaphore/locking mechanism (the usual for managing access to finite resources) or you just ensure that every thread/process has a private Singular interface instance to talk to.
The way files are shared across a fork is tricky (as in: unix doesn't really help you with that). In general, you're probably safest by assuming that after a fork, any interface instances in the child inherited from the parent are not functional (i.e., they belong to the parent), so any interfaces that you use in the child should be instantiated after the fork.