Deutsch   English   Français   Italiano  
<vv6hhn$rebo$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups: comp.lang.c++
Subject: Re: Futex Stack Test...
Date: Sat, 3 May 2025 18:57:11 -0700
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <vv6hhn$rebo$1@dont-email.me>
References: <vp0g2q$1bu96$1@dont-email.me>
 <vv28lf$v2jv$1@raubtier-asyl.eternal-september.org>
 <vv3smk$2d66g$1@dont-email.me>
 <vv3ui8$2iqp0$1@raubtier-asyl.eternal-september.org>
 <vv40u4$2kni8$1@raubtier-asyl.eternal-september.org>
 <vv5ln8$26ei$1@dont-email.me>
 <vv5mn0$38ie$1@raubtier-asyl.eternal-september.org>
 <vv5shh$89nm$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 04 May 2025 03:57:17 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="46c1c4bdc6cd2a07bd1f781241e22615";
	logging-data="899448"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18KxnbUlQteh2XM/KJdw4fKdjYnuvDvO9g="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Lp/4P81n5o2UCE/gAi0u14bQ9jw=
In-Reply-To: <vv5shh$89nm$1@dont-email.me>
Content-Language: en-US

On 5/3/2025 12:58 PM, Chris M. Thomasson wrote:
> On 5/3/2025 11:19 AM, Bonita Montero wrote:
>> Am 03.05.2025 um 20:02 schrieb Chris M. Thomasson:
>>
>>> Now, its fun to be able to get a lock-free stack with only single 
>>> word exchange and cas, and have the ability to use it with a futex to 
>>> allow one to wait on empty conditions.
>>
>> Is a lock-free stack with a single word CAS really possible without an
>> ABA-problem ?
> 
> Will get back to you. Need to run a bunch of errands. If you omit single 
> item pop, yup. It's also possible to get rid of the cas in push.

The ABA problem _and_ memory issue is only there in on the single node 
pop for a lock-free stack. If you just whack it with a nullptr aka flush 
_all_ nodes, then you are all right and ready to roll.

Actually, IBM had/has a nice write up of it in an appendix for the 
principles of operations iirc. I think it might of been in appendix 40 
ish or something. God it's been a while since I read that Bonita. Then 
they have a rather nifty PLO, or perform locked operation, again iirc...

The futex is fun to use because it allows one to wait on an empty 
condition...

Actually, I remember Joe Seigh taking all the nodes in an exchange, 
reversing them, and BAM, its FIFO. ;^)

> [...]