G
g
Hello,
Wouldn't be better shared_ptr constructor to have an argument
<true/false> for thread-safe reference counting?? The default should be
true and in case you dont want thread-safe RC create a shared_ptr with
false in constructor. The reason for this is to avoid the cost of the
memmory barriers where you don't need them.
At the moment if your application is multithreaded boost will choose to
use thread-safe RC but in many cases( local containers with
shared_ptrs) thread-safe RC doesn't have any sense.....becouse the
objects are owned by only one thread.
in this cases, the best way to go is to use an instrusive_ptr where the
developer implements the RC??
thanks in advance,
Wouldn't be better shared_ptr constructor to have an argument
<true/false> for thread-safe reference counting?? The default should be
true and in case you dont want thread-safe RC create a shared_ptr with
false in constructor. The reason for this is to avoid the cost of the
memmory barriers where you don't need them.
At the moment if your application is multithreaded boost will choose to
use thread-safe RC but in many cases( local containers with
shared_ptrs) thread-safe RC doesn't have any sense.....becouse the
objects are owned by only one thread.
in this cases, the best way to go is to use an instrusive_ptr where the
developer implements the RC??
thanks in advance,