Boost logo

Boost :

From: Andy Glew (glew_at_[hidden])
Date: 1999-12-30 20:01:14


> I see that the reason for non-thread-safe implementation is the platform
> independence issue.

Some of us also worry about the performance implications.

E.g. I don't need multithreading in my simulator, why should I pay
for it? (Since I'm about 10X too slow, I *hate* the thread safety
attempts that GCC's STL makes.)

E.g. even if I were multithreading, it's wasteful to synchronize
in low level constructs like smart pointers, if they are used as
part of higher level constructs that have their own synchronization.

> Andy - you said most compilers won't have a problem with the code I pointed
> at. Do you know, by any chance, if MSVC++6.0 handles it correctly ?

No. I do my programming on UNIX mostly.

MSVC++ does do pretty good optimization, so CSE'ing to prevent the
double load is probably done. *But*, they optimize for size a lot,
and the vulnerable version is smaller.

Moral: you can't rely on it.

But it doesn't matter: MUTEX the heck out of everything!!!!


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk