C++ Logo

std-proposals

Advanced search

Re: Formalisation of std::get<>'s behavior with regards to concurrency

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Sat, 8 Jun 2019 13:30:10 +0200
Hi,

Il 07/06/19 19:12, Francois Chabot via Std-Proposals ha scritto:
> As far as I can tell, there is no particular reason why two threads
> shouldn't be able to write to different fields of a `std::tuple<>`, a
> `std::array<>` or a `std::pair<>` using `std::get<>()` concurently, yet
> this is currently not allowed by ommision.
>
> Would a proposal to add language similar to
> [container.requirements.dataraces] in order to formalize this be receivable?

How about raising a defect? I don't see why std::get on tuple/array/pair
shouldn't _already_ be thread-safe (given that ultimately it ends up
accessing different subobjects).

My 2 c,
-- 
Giuseppe D'Angelo | giuseppe.dangelo_at_[hidden] | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Received on 2019-06-08 06:32:01