2143. ios_base::xalloc should be thread-safe

Section: 31.5.2 [ios.base] Status: C++14 Submitter: Alberto Ganesh Barbati Opened: 2012-03-14 Last modified: 2016-01-28 10:19:27 UTC

Priority: Not Prioritized

View all other issues in [ios.base].

View all issues with C++14 status.


The static function ios_base::xalloc() could be called from multiple threads and is not covered by [res.on.objects] and [res.on.data.races]. Adding a thread-safety requirement should not impose a significant burden on implementations, as the function can be easily implemented with hopefully lock-free atomics.

[2013-04-20, Bristol]


Resolution: move tentatively ready. (Inform Bill about this issue.)

[2013-09-29, Chicago]

Apply to Working Paper

Proposed resolution:

This wording is relative to N3376.

  1. In [ios.base.storage] add a new paragraph after paragraph 1:

    static int xalloc();

    -1- Returns: index ++.

    -?- Remarks: Concurrent access to this function by multiple threads shall not result in a data race (6.9.2 [intro.multithread]).