I would like to ask a few conditional questions regarding the
Hi Patrick, On 2/19/26 6:59 AM, Patrick Jacobs wrote: possibility of personally implementing a multi-state/context architecture for GiNaC. It's not an issue of there being some non-thread-safe global state. There is, but it's small, and you could probably make access to it safe in a straightforward way. The real issue is that every GiNaC object is reference-counted. An expression like x^2+2*x*y+y^2 holds symbol x (refcount 2), symbol y (refcount 2), symbol 2 (refcount 3) and then there's the entire add object (refcount 1). And when you manipulate it, a multitude of refcounts get incremented or decremented. That would have to be done in a thread-safe atomic way. And numeric objects hold CLN objects and these are reference-counted, too. Long time ago, there've been discussions about multi-threading here: <https://lists.ginac.de/archives/list/ginac-list@ginac.de/thread/LJ6HYGOKEY6HAOJ26S5GWRYAQTM2VKKQ/> <https://lists.ginac.de/archives/list/ginac-list@ginac.de/thread/RVUTFC3UMYILBHMNPCWO6EIZURMPDDG2/> <https://lists.ginac.de/archives/list/ginac-list@ginac.de/thread/YO3QDSQH4SNKWSQ2Z6A6OR25S2AXNRDG/> That said, I'm not a real expert in multi-threading. All my best, -richard. -- Richard B. Kreckel <https://in.terlu.de/~kreckel/>