RE: [Reflex] Thread safety

From: Jean-Francois Bastien <jfbastien_at_cae.com>
Date: Wed, 23 Jan 2008 12:27:15 -0500


> 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:28:06 CET

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