[Bf-committers] Is the Data API thread-safe?

Brecht Van Lommel brecht at blender.org
Tue Nov 17 14:03:19 CET 2009


Hey Emil,

On Mon, Nov 16, 2009 at 7:24 PM, Emil Brink <emil at obsession.se> wrote:
> Hi!
>
> Simple question, that has been nagging me since the Conference: is the
> (very nice-looking) Data API thread-safe?
>
> That is, if I create a new thread from within Blender's main process,
> can I call various RNA_xxx() functions from it (like
> RNA_path_resolve(), or  RNA_property_int_set()) from it, and expect
> Blender to Do The Right Thing?

No, it's not thread safe unfortunately. There's no general mutex
locking mechanism for data in Blender, which I guess is would be the
typical way to implement this. On the Data API side it would be
relatively simple to implement, but all the other Blender code
accesses data without any checks, and making that thread safe would
require changes all over the code.

Brecht.


More information about the Bf-committers mailing list