II would love to use this cool library for a project.
In this project I have many closed physic systems, which need to be computed parallel, like parallel physics worlds.
The question is if it is possible to use many instances of VerletPhysics2D simultaneuslly?
Something like:
VerletPhysics2D physics1, physics2, … , physicsN ;
Yup! We can have as many instances of that class as we want!
However, multiple instances of some class got nothing to do w/ multithreading!
If a particular instance of a class is accessed by more than 1 thread, and at least it is mutated by 1 of those threads, all of those accesses may need to be synchronized () { }!
AFAIK, all Processing’s 3rd-party libraries don’t use any synchronization internally.
Therefore, it’s up to us to use that ourselves if we have multithreading access in our sketches.