2143. ios_base::xalloc should be thread-safe

Section: 30.5.3 [ios.base] Status: C++14 Submitter: Alberto Ganesh Barbati Opened: 2012-03-14 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [ios.base].

View all issues with C++14 status.

Discussion:

The static function ios_base::xalloc() could be called from multiple threads and is not covered by 20.5.4.10 [res.on.objects] and 20.5.5.9 [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]

Unanimous.

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 30.5.3.5 [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.8.2 [intro.multithread]).