Bug 24347 - Document boost_shared_ptr vs concurrency
Summary: Document boost_shared_ptr vs concurrency
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.1.0
: P2 enhancement
Target Milestone: ---
Assignee: Jonathan Wakely
URL:
Keywords: documentation
Depends on:
Blocks:
 
Reported: 2005-10-13 09:18 UTC by Paolo Carlini
Modified: 2007-12-17 22:14 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-11-09 17:52:14


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Carlini 2005-10-13 09:18:05 UTC
In our GNU version rather puzzling solutions appear like:

  void
  release() // nothrow
  {
    if (__gnu_cxx::__exchange_and_add(&_M_use_count, -1) == 1)
    {
      dispose();
      __glibcxx_mutex_lock(_M_mutex);
      __glibcxx_mutex_unlock(_M_mutex);
      weak_release();
    }
  }

with empty critical regions, and what else. Document that, possibly
mentioning the current weaknesses both from the point of view of
correctness and performance and mentioning alternate solutions.
Comment 1 Jonathan Wakely 2005-11-09 17:51:04 UTC
We need to doc much more than that ... we don't have any docs saying which TR1 components are supported or how to make use of them, do we?

I had some changes on my hard drive adding docs to the docs/html/ext pages, but now that TR1 is officially sanctioned it might deserve a new docs/html/tr1 dir.

Assign this to me if you want.
Comment 2 Paolo Carlini 2005-11-09 17:52:14 UTC
Your are welcome!
Comment 3 Jonathan Wakely 2007-11-06 14:34:29 UTC
Some related discussion:
http://gcc.gnu.org/ml/libstdc++/2007-10/msg00180.html
Comment 4 Jonathan Wakely 2007-12-17 22:14:19 UTC
Between http://gcc.gnu.org/onlinedocs/libstdc++/20_util/shared_ptr.html
and http://gcc.gnu.org/onlinedocs/libstdc++/ext/concurrence.html and the shared_ptr code, which has been simplified and commented, I think this can be closed.