Closed XVilka closed 5 years ago
I don't think the Capstone
struct will ever be Send
or Sync
because of how the struct is stored.
The Capstone
struct holds a csh
which is essentially a pointer to an opaque C struct. Any way to make the it safe to share across threads (like an internal mutex) would increase the overhead for the single-threaded case.
If you want to disassemble in parallel, then I suggest you create a separate Capstone
in each thread. You could create a function/closure that creates a Capstone
like you want then use that function in each thread.
I should really have an multi-threaded example.
To be able to call like