C# offset curve on surface threaded

Hey all!

Firstly, really impressed by RhinoCommon. Great work everybody who was involved with that!

I’m working on a project with a lot of heavy processing and large batches.
Mostly I’m working on grasshopper plugins in C#, being called from a grasshopper patch.
One node might take 5 minutes to execute.

I’ve been trying to thread some of the expensive functions, but always hit exceptions.

For example Curve.OffsetOnSurface will crash even if I guarantee that no 2 threads have simultaneous access to the same Curve or the same BrepFace.

(crash is causeed by either corrupted output or an AccessViolation)

It seems the function shares some kind of state internally in Rhino which can’t be used concurrently in 2 threads.
Is there any information about which types of functions can be performed thread-safe and which ones can’t?

No there is not.

Can you post a simple example of something that crashes for you?

– Dale