Closed Christopher22 closed 3 years ago
Thanks a lot!
Could you please add a minimal integration test for your safe-multithreading implementation? In this way we can immediately verify if a problem arises.
Any idea for such a test? To the best of my knowledge, there is no way replicating test behavior exactly between at least two threads. Even if there would be an error, it is most likely a Heisenbug.
However, I would call it overkill nevertheless. The C world is almost completely "Send"y by default. I think we are safe by referring to the FFMS2 documentation which does not give any hint for thread-local storage or thread-specific locks. Besides, some functions of the library are explicitly NOT sync: If they would be, that might be a hint for mutexes or something like that. :)
I can't come come up with a test that does not consider ffsm2
directly, so we can merge this PR as-is for now
Nice!
Currently, the crate is too restrictive in terms of multithreading. While the underlying FFMS2 pointers might not allow concurrent access from different threads (and are consequently not "Sync"), they rely neither on thread-local storage nor thread-specific locks and is therefore safe to send.