| Deutsch English Français Italiano |
|
<vvjc8o$27602$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: jseigh <jseigh_es00@xemaps.com> Newsgroups: comp.lang.c++ Subject: Re: Futex Stack Test... Date: Thu, 8 May 2025 18:46:48 -0400 Organization: A noiseless patient Spider Lines: 35 Message-ID: <vvjc8o$27602$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> <vv6hhn$rebo$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 09 May 2025 00:46:49 +0200 (CEST) Injection-Info: dont-email.me; posting-host="259ba43e1b7386be377036db25805907"; logging-data="2332674"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/s+AqXgrkEIC/xpFItljE" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:2usc0rk30y0WNrJY4HlqtGxcio0= In-Reply-To: <vv6hhn$rebo$1@dont-email.me> Content-Language: en-US Bytes: 2864 On 5/3/25 21:57, Chris M. Thomasson wrote: > 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. ;^) > Probably for a MPSC queue. I don't the FIFO semantics would hold up very well for MPMC queue. Joe Seigh