comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@TheWorld.com>
Subject: Re: Reference counter in smart pointers are not updated properly when used by multiple tasks
Date: Thu, 01 Feb 2018 14:04:58 -0500
Date: 2018-02-01T14:04:58-05:00	[thread overview]
Message-ID: <wcc372kjztx.fsf@TheWorld.com> (raw)
In-Reply-To: a89d76e4-a2b2-4ad9-8816-f3bfe9686930@googlegroups.com

onox <denkpadje@gmail.com> writes:

>... so I am using atomics (GCC's
> __sync_sub_and_fetch_4) ...

There is a version of Ada.Strings.Unbounded that
uses atomics for reference counting.  You could look
at that as an example.  Look at a-strunb.ads.
If it has this comment near the top:

--  This package provides an implementation of Ada.Strings.Unbounded that uses
--  reference counts to implement copy on modification (rather than copy on
--  assignment). This is significantly more efficient on many targets.

--  This version is supported on:
--    - all Alpha platforms
--    - all ia64 platforms
--    - all PowerPC platforms
--    - all SPARC V9 platforms
--    - all x86 platforms
--    - all x86_64 platforms

then that's the right version to look at.

- Bob


      parent reply	other threads:[~2018-02-01 19:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01  5:52 Reference counter in smart pointers are not updated properly when used by multiple tasks onox
2018-02-01  8:39 ` Dmitry A. Kazakov
2018-02-01 10:01   ` onox
2018-02-01 10:28     ` onox
2018-02-01 10:51       ` Dmitry A. Kazakov
2018-02-01 10:57     ` Dmitry A. Kazakov
2018-02-01  8:41 ` Simon Wright
2018-02-01 14:48 ` Jeffrey R. Carter
2018-02-01 19:37   ` onox
2018-02-01 20:12     ` Jeffrey R. Carter
2018-02-02  0:09   ` Randy Brukardt
2018-02-01 19:04 ` Robert A Duff [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox