Boost logo

Boost :

From: Don G (dongryphon_at_[hidden])
Date: 2005-02-13 16:16:27


Hi Peter,

> Yes, I had considered a mutex pool. One problem is that
> boost::shared_ptr is header-only, and must remain so for
> backward compatibility reasons.

Well, that would preclude such an optimization, though I am not sure
how adding a .cpp file would break code (just makefiles<g>).

> Another problem is that a CRITICAL_SECTION needs to be
> dynamically initialized before use, but the initialization
> itself also needs synchronization.

Unless it happens at global construction time as with Singleton. You
are correct that the pseudo code I posted would not work if mutex ==
CRITICAL_SECTION.

> It is easy to apply this optimization to std::tr1::shared_ptr,
> though, since standard libraries don't need to be header-only
> and can initialize things before everything else. ;-)

Good news indeed!

Best,
Don

=====

                
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail


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