Re: [Reflex] Thread safety

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Thu, 24 Jan 2008 15:22:24 +0100


Hi Jean-Francois,

there are several issues here: I was referring to the thread safety of Reflex itself (the database access).

You are now referring to the execution engine. The easiest way I can see for making that one thread safe is by passing the result buffer in from outside, instead of returning it. I do not plan to introduce this within the next 1/2 year, though.

Cheers, Axel.

On 2008-01-24 15:04, Jean-Francois Bastien wrote:

>> Later access of the registered types is thread safe, though, 
>> because the containers are only being read.

>
> I'm correcting myself here: invoking methods which have a return value
> isn't thread safe since the generated code looks something like:
>
> static void* method_20845( void* o, const std::vector<void*>&, void*)
> {
> static SomeReturnType ret;
> ret = ((const ::MyNamespace::MyClass*)o)->SomeMethod();
> return &ret;
> }
>
> That static function variable can be overwritten by multiple threads.
>
>
> JF
>
>
Received on Thu Jan 24 2008 - 15:22:28 CET

This archive was generated by hypermail 2.2.0 : Thu Jan 24 2008 - 17:50:01 CET