I have a question regarding multithreading. As far as I know it is possible to outsource the calculation like Intersection, Closest Point to many threads.

Is something like this also possible with Mesh.Facees.AddFace(int, int , int)?
Or are there other possibilities to shorten the computing time?

Look forward to your expertise!

Adding to the Mesh means modifying it, but then different threads starts fighting Data Races, where one thread A adds a face and another thread B tries too but didn’t know that A had just added the face and…

The Mesh isn’t thread safe for writing. But you can read info from it in parallel.

What you can do is to add faces in “batch”, like so:


That’s pretty fast.

// Rolf

Multi threading is the 0.1 % while a thread safe policy is the 99,9%. The wast majority of people attempting to exploit // ways forget that fact.

In general anything imaginable could be written with a // approach BUT only if the cost is worth the benefit.

Read what the Master has to say on that matter: