C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] [isocpp-parallel] atomics in C++

From: Uecker, Martin <Martin.Uecker_at_[hidden]>
Date: Tue, 22 Jun 2021 05:35:08 +0000

Am Montag, den 21.06.2021, 19:49 +0000 schrieb Billy O'Neal (VC LIBS):
> (2 different DLLs which link different CRTs have no means to
> coordinate on where the lock table lives)

Out of curiosity: Why is this so? In principe, this does not
sound imossible...

And does this imply that other state in the standard library
is then also not shared between different parts of a program?


Martin



> Billy3
> ________________________________
> From: Liaison <liaison-bounces_at_[hidden]> on behalf of Jens Maurer via Liaison <
> liaison_at_[hidden]p.org>
> Sent: Saturday, June 19, 2021 01:55 PM
> To: Uecker, Martin <Martin.Uecker_at_med.uni-goettingen.de>; parallel_at_lists.isocpp.org <
> parallel_at_[hidden]>; liaison_at_lists.isocpp.org <liaison_at_lists.isocpp.org>
> Cc: Jens Maurer <Jens.Maurer_at_gmx.net>
> Subject: Re: [wg14/wg21 liaison] [isocpp-parallel] atomics in C++
>
> On 19/06/2021 22.49, Uecker, Martin wrote:
> > Since _Atomic_ref(T) is basically a pointer the
> > corresponding C type would then be _Atomic T*.
> >
> > But would we need to wrap it into a struct
> > for ABI compatibility?
>
> It would be the ABI group's job to ensure that C's
> hypothetical "_Atomic T *" is equivalent to C++'s
> std::atomic_ref<T>.
> For x86-64, I think there is no difference between
> a plain pointer and a pointer wrapped in a struct
> (as its single member). If an ABI makes a difference
> here, it would need to carve out a special case for
> "_Atomic T *".
> > > The question is whether we can/should/want to have a standard-based
> > > compatibility story for "atomic reference" or not.
> > > We've recently made "_Atomic(T)" the compatibility advice
> > > for atomic types in code shared between C and C++. Good.
> >
> > I am am also not sure. For me _Atomic_ref would be something
> > used mainly internally in a library, e.g. where an
> > external interface passes a data structure without atomic
> > types and then the library wants to apply a concurrent
> > algorithm on the existing data structure.
>
> Maybe the -parallel group of WG21 has some opinion here.
>
> Jens
>
> _______________________________________________
> Liaison mailing list
> Liaison_at_[hidden]
> Subscription:
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.isocpp.org%2Fmailman%2Flistinfo.cgi%2Fliaison&amp;data=04%7C01%7Cbion%40microsoft.com%7C98c6ddb670ae4af04b4b08d933649c8a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637597329498344954%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=GXAEDtUygZidgL89%2F7sc%2FfC9aRrMNZRY%2BJOUE83WYMs%3D&amp;reserved=0
> Link to this post:
> https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.isocpp.org%2Fliaison%2F2021%2F06%2F0624.php&amp;data=04%7C01%7Cbion%40microsoft.com%7C98c6ddb670ae4af04b4b08d933649c8a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637597329498344954%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Eu5H%2BNgoRn0cBxKk67NhH%2FhmvWKUE%2F9rnQ%2FJzH1yHGc%3D&amp;reserved=0

Received on 2021-06-22 00:35:19