Re: [Reflex] Thread safety

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Wed, 23 Jan 2008 18:34:46 +0100


Hi Jean-Francois,

 > If you guys are open to us suggesting such things for the new Reflex  > API then we'd be very happy :-)

Yes - but not at all costs. It should not increase the instruction cost (at least not by a lot), and it should not obscure interfaces: an std::string is well known; a Reflex::String is not - and I don't like the idea of wrapping every single STL class, and re-implementing (and maintaining) their member functions for each supported platform.

So it might boil down to a compromise, but I'd still like to see your proposal!

Cheers, Axel.

>>   Axel has just checked in some changes that should help to 
>> fix this problem - or, at least, generate compiler warnings 
>> you when things you are doing are about to go badly wrong.
>>
>>   The problem boils down to MS having different API for STL 
>> when debugging is on vs with optimization is on. This is 
>> because they add all sorts of cross-checks (did you index 
>> past the end of a vector, etc.) and apparently to do some of 
>> this they had to modify the API of the library.
>> This can be switched off with some #defines, which Axel's 
>> modification does.

>
> Yes:
> #define _SECURE_SCL 0
> #define _HAS_ITERATOR_DEBUGGING 0
>
> This isn't great, though, because these extra checks are very useful.
> They unfortunately change the layout of the classes.
>
> But it's deeper than this. When our projects have APIs designed to be
> very binary compatible, but passing from MSVC 7.1 to 8.0 caused some
> trouble with exceptions (if a user was still on 7.1 and we were on 8.0).
> Everything was working except this.
>
> We've come to a point where all the code that's visible to users (the
> API in the .h files) is free of STL and any other type we're not certain
> is designed to our binary compatibility standards. We use the STL, Boost
> and others extensively internally, but we hide or wrap them at our API's
> boundary (and no, we don't use void * in our API).
>
> If you guys are open to us suggesting such things for the new Reflex API
> then we'd be very happy :-)
>
>
> JF
>
Received on Wed Jan 23 2008 - 18:35:00 CET

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