Note to self: Brep.CreateSolid is not thread safe

Or at least I think so…
After a week of funny multitask debugging and restarting my project from scratch, turns out it wasn’t really my fault ;p
Luckily, Brep.JoinBreps seems to be ok, so you just have to trim all the stuff yourself…
Can anyone confirm this?

@stevebaer @dale

Hi @capitaine_fred,

Can you provide some sample code, which we can run here, that isn’t working for you?


– Dale

Hi @dale ,
Actually I just had another crash, so maybe I just changed the timing when I changed my code and the access violation just occurs less often.
I absolutely don’t understand where it could come from. I’ve made everything immutable and use static methods etc, but I must have missed something.
So I’ll revisit this next week probably, but I have to finish the alpha for Thursday. I’ll keep you posted.
Thank you.

Was version / service release of Rhino are you using?

Win 64
Version 6 SR26
(6.26.20147.6511, 26/05/2020)

@dale, @stevebaer
Sorry, my schedule is a bit tighter than anticipated, I haven’t had the time to investigate further yet. Plus, I signed an NDA for this project so I would have to strip a lot of stuff to show you some code…
All I can say is that I removed a call to ActiveDoc.ModelAbsoluteTolerance that I had missed before and had no crashes since. I haven’t tried CreateSolid again at this time.

Hi @capitaine_fred,

Calling into the Rhino document, which is not thread-safe, from a tread is certainly a no-no.

Thanks for the update.

– dale