The C++ documentation says
Threading
None of the code is thread-safe, by design. That said, since currently a FlatBuffer is read-only and entirely const, reading by multiple threads is possible.
This sounds problematic, one might want to use Flatbuffers for example from a network communication thread while at the same time writing preferences to disk in another thread. I can't find anything in the code during a quick glance that would go bad by doing that (global variables, function static variables etc), but since it's not guaranteed to work obviously I can't use it.
Is it actually safe to use different objects from different threads? In that case I think the documentation should be clearer about that. Otherwise I also think the documentation should be clearer about that, maybe including a short explanation as to why such a (very reasonable) thread safety guarantee is impossible.
The C++ documentation says
This sounds problematic, one might want to use Flatbuffers for example from a network communication thread while at the same time writing preferences to disk in another thread. I can't find anything in the code during a quick glance that would go bad by doing that (global variables, function static variables etc), but since it's not guaranteed to work obviously I can't use it.
Is it actually safe to use different objects from different threads? In that case I think the documentation should be clearer about that. Otherwise I also think the documentation should be clearer about that, maybe including a short explanation as to why such a (very reasonable) thread safety guarantee is impossible.