Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #120602
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: Ported my proxy collector... |
| Date | 2024-10-05 12:00 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <vds2cc$rsd3$3@dont-email.me> (permalink) |
| References | <vcadq3$340q3$1@dont-email.me> |
On 9/16/2024 4:08 PM, Chris M. Thomasson wrote:
[...]
> public:
> collector& acquire()
> {
> // increment the master count _and_ obtain current collector.
> unsigned int current =
> m_current.fetch_add(0x20U, std::memory_order_acquire);
>
> // decode the collector index.
> return m_collectors[current & 0xFU];
> }
Not that bad for acquiring a strong reference to a collector. A wait
free fetch_add, on arch's that support it. Well, pretty nice.
> void release(collector& c)
> {
> // decrement the collector.
> unsigned int count =
> c.m_count.fetch_sub(0x20U, std::memory_order_release);
>
> // check for the completion of the quiescence process.
> if ((count & 0xFFFFFFF0U) == 0x30U)
> {
> // odd reference count and drop-to-zero condition
> detected!
> prv_quiesce_complete(c);
> }
> }
Well, this is not that bad as well. I had a lot of fun designing it.
[...]
Back to comp.lang.c++ | Previous | Next — Previous in thread | Find similar | Unroll thread
Ported my proxy collector... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-09-16 16:08 -0700
Re: Ported my proxy collector... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-09-16 16:15 -0700
Re: Ported my proxy collector... Muttley@dastardlyhq.com - 2024-09-17 07:38 +0000
Re: Ported my proxy collector... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-09-17 11:46 -0700
Re: Ported my proxy collector... Muttley@dastardlyhq.com - 2024-09-18 07:20 +0000
Re: Ported my proxy collector... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-09-18 12:27 -0700
Re: Ported my proxy collector... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-09-22 12:40 -0700
Re: Ported my proxy collector... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-09-21 15:05 -0700
Re: Ported my proxy collector... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-10-04 11:53 -0700
Re: Ported my proxy collector... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-10-05 12:00 -0700
csiph-web