utwente-fmt / sylvan

Multi-core Decision Diagram (BDD/LDD) implementation
Apache License 2.0
41 stars 8 forks source link

Is the library thread safe? #10

Closed thisiscam closed 7 years ago

thisiscam commented 7 years ago

I'm trying to use sylvan from multiple threads. If my understanding is correct, it should also be fine to call sylvan_and from multiple threads?

Currently I'm wrapping "and" with the following code, with a LACE_ME directive: https://github.com/thisiscam/SylvanSharp/blob/master/wrapper/wrapper.c#L42

However, it appears that if I invoke this method from multiple threads, I got a segfault. I haven't looked into gdb-ing it yet, but any insight would be helpful(as I might be totally wrong with something)! Thanks!

thisiscam commented 7 years ago

Nvm, I figured out that I need to "lacify" my threads created in C#, by which I've created a C# Lace.ParallelFor for ease of use: https://github.com/thisiscam/SylvanSharp/blob/master/SylvanSharp/SylvanSharp/Lace.cs#L57

johnyf commented 7 years ago

Please consider including a commit hash when you refer to lines of code.