Re: [Reflex] Thread safety

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Wed, 23 Jan 2008 16:30:23 +0100


Hi Jean-Francois,

On 2008-01-23 16:16, Jean-Francois Bastien wrote:

>> I am currently replacing the platform dependent hash map 
>> implementation with a generic one. The static member 
>> functions you refer to are moved to a new class (Catalog) 
>> that implements a singleton for now, and will be a 
>> per-process singleton and a per-thread "singleton" in the 
>> future to allow for per-thread types for a future _threaded_ 
>> interpreter. The latter doesn't need thread safety support, 
>> only the per-process one does.

>
> Do you mean that a dictionary will only be accessible from the process
> and thread in which it was registered?
> Or that the singletons are per thread and per process and are
> synchronized together?
> I think the former is a bad idea, I want one DLL to publish its types
> and I want to be able to dynamically attach a debugger that queries
> Reflex to look at the dictionary and the instantiated classes and
> interact with them.

We will have a dictionary per process and an optional dictionary per thread. The reason is that interpreter instances, local to a thread, can load C++ sources and fill their local dictionary with new reflection data. Shared libraries that are accessible on the process level (loaded by whichever thread) should of course fill their reflection data into the process' reflection database. The lookup mechanism will need to be extended to cover both dictionaries automatically.

>> So: if you can wait for a few weeks then please check out the 
>> new reflex. And if you need multi-threading support before we 
>> do I'd be extremely pleased to see a patch for Reflex's new 
>> hash map adding thread safety :-)

>
> I can wait, but we do have plans to use Reflex in the race condition
> scenario that I outlined. I've got a few other things to tackle with
> Reflex, when they're done I'll see if you've started work and if not I
> will. I'll provide feedback on your implementation, it's very important
> to me (I'm not the only one working on this, what I write isn't one
> man's opinion!).

OK, very good - we have several "outside" (i.e. non-HEP) users, and currently the major problem is reflex's lack of performance. We see a slow-down of a factor 16 in out C++ interpreter now that it uses Reflex - I need to fix that urgently. That's why I prefer to continue writing that new, fast version of Reflex before working on e.g. thread safety. Still, I of course take thread safety into account when designing the (few) changes in the reflex API. As outlined in my previous email.

I would really appreciate your feedback on the new version; I will let you know when it's ready.

Cheers, Axel. Received on Wed Jan 23 2008 - 16:30:32 CET

This archive was generated by hypermail 2.2.0 : Wed Jan 23 2008 - 23:50:01 CET