From: Branko Èibej (branko.cibej_at_[hidden])
Date: 2000-06-09 08:42:06
"Borgerding, Mark A." wrote:
> I admit, at first, I was a bit repulsed by the idea of having two MT-safe
> versions of a library, however I am beginning to embrace the desire to
> create the most efficient binary possible.
> However, it is impossible to tell reliably at compile time whether the
"At library writing time"
> target platform is SMP or not. Because of this fact, we should opt for
> safety and ease of library use over possible gains in efficiency.
> If two versions are chosen, I feel that the default BOOST_MT version should
> be safe for SMP, with the uniprocessor version ( BOOST_MT_1P ? ) as a
> special optimization that could be activated only by a macro definition.
> This way, the library would be safe for anyone to use "right out of the
> box", but those who need a tad more speed on a uniprocessor system can RTFM
> to learn that they should define a preprocessor macro in their Makefile or
> project file.
Right. IMHO this could be another general Boost guideline: Always choose
safety over efficiency. When providing both, make the safer implementation
(The user of the library can shoot herself into the foot, but at least you'll
hand her the gun with the safety catch on.)
-- Branko Èibej <branko.cibej_at_[hidden]> HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia voice: (+386 1) 586 53 49 fax: (+386 1) 586 52 70
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk