🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c++
Article #848

Re: How to write a semaphore with futexes

#848
From: Ross Finlayson
Date: Fri, 13 Nov 2026 13:49
76 lines
4741 bytes
On 11/13/2026 04:50 AM, Ross Finlayson wrote:
> On 11/13/2026 02:07 AM, boltar@caprica.universe wrote:
>> On Thu, 12 Nov 2026 11:35:24 -0800
>> Ross Finlayson <ross.a.finlayson@gmail.com> gabbled:
>>> On 11/12/2026 08:41 AM, boltar@caprica.universe wrote:
>>>> On Wed, 11 Nov 2026 15:05:43 -0800
>>>> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
>>>>> On 11/11/2026 2:47 PM, Bonita Montero wrote:
>>>>>> Am 11.11.2026 um 23:12 schrieb Chris M. Thomasson:
>>>>>>
>>>>>>> I see. A fun failure on a sem_wait is EINTR.
>>>>>>
>>>>>> That's not a out of recources error and it is recoverable.
>>>>>
>>>>> Its scary though when people fail to know about it.
>>>>
>>>> Anyone who doesn't read the man page before they use an unfamiliar
>>>> function
>>>> frankly deserves what they get.
>>>>
>>>
>>>
>>> Here's one for you.
>>>
>>> So, I want a MPSC queue, multiple-producer single-consumer queue,
>>> producers on the order of 1000, with that appends to the queue push(),
>>> push_back, pretty much must use compare-and-swap the only atomic
>>
>> Blah blah.
>>
>> Sorry, what's your point exactly? That people shouldn't bother reading
>> the
>> man page about a function or whatever other documentation is available
>> before
>> they try to use it?
>>
>
> Ah, good old linear thinking.
>
> Basically looking to make sense of the great circle of things,
> of course a lot depends on "the stability of fact", vis-a-vis
> something like Magritte's "The Treachery of Images" vis-a-vis
> "The Empire of Light", point being that I've already read the
> man pages most of them. (Man pages, RFC's, standards & specifications,
> like from ITU and ISO.)
>
> So, my point is a sort of retro approach to simple and practical
> systems, to live in a world of modern systems, since the logical
> and abstract is about things like "C, C++, and POSIX", in a world
> of "many-core hyper-virtualized containerized boxes", and about
> things like "Internet protocols" and "distributed systems".
>
>
> The idea is to write what are of the good old specifications
> in the good old code, with modern expectations of the runtime.
>
> Then, the code should also be well-designed and written from
> the beginning to cover the relevant surface of the runtime,
> while having the nice abstraction and these sorts of things.
>
>

Of course "the only current documentation is the source",
and it's so that anybody who ever ran doxygen on their code
the first time were probably very happy with their results,
about things like "literate programming", and "thinking like
a library author", that the "code understanding" is much
facilitated by elegant, declarative, purposeful code,
that said what I'm interested in are reference implementations
of standards in a composable way, that happen for example to
be demonstrably complete and making best use of the resources
responsibly. "Good actors."



Technical Details
Message-ID: <JeydnerpfZHwiGr3nZ2dnZfqnPqdnZ2d@giganews.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-4.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
References: <11cvher$2ahke$1@raubtier-asyl.eternal-september.org> <11d02gm$2h8g0$1@dont-email.me> <11d145g$2qlhs$1@raubtier-asyl.eternal-september.org> <11d2p9c$3eke4$1@dont-email.me> <11d2r97$3f9sa$2@raubtier-asyl.eternal-september.org> <11d2sca$3fn5d$1@dont-email.me> <11d4q72$bdct$1@dont-email.me> <0iGdnbMEEbSZiGv3nZ2dnZfqnPqdnZ2d@giganews.com> <11d6ngs$1tvjm$1@dont-email.me> <_NScnclW29oSmmr3nZ2dnZfqn_ednZ2d@giganews.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-4.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 13 Nov 2026 13:49:33 +0000
Subject: Re: How to write a semaphore with futexes
Newsgroups: comp.lang.c++
References: <11cvher$2ahke$1@raubtier-asyl.eternal-september.org>
 <11d02gm$2h8g0$1@dont-email.me>
 <11d145g$2qlhs$1@raubtier-asyl.eternal-september.org>
 <11d2p9c$3eke4$1@dont-email.me>
 <11d2r97$3f9sa$2@raubtier-asyl.eternal-september.org>
 <11d2sca$3fn5d$1@dont-email.me> <11d4q72$bdct$1@dont-email.me>
 <0iGdnbMEEbSZiGv3nZ2dnZfqnPqdnZ2d@giganews.com>
 <11d6ngs$1tvjm$1@dont-email.me>
 <_NScnclW29oSmmr3nZ2dnZfqn_ednZ2d@giganews.com>
From: Ross Finlayson <ross.a.finlayson@gmail.com>
Date: Fri, 13 Nov 2026 05:49:24 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <_NScnclW29oSmmr3nZ2dnZfqn_ednZ2d@giganews.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <JeydnerpfZHwiGr3nZ2dnZfqnPqdnZ2d@giganews.com>
Lines: 76
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-rstE9c/4mt25B8dbjx6dJXnrAfwEOFUutsOfhiK/zzS7EnGikbxW9BV/YxDB9qBorM15UR/+DjaHYmv!Cyj+BXOUZSgt0iMuO7/4B5aVPBxouCTtCkUw66pZDM+PE5A+fubUM9K275wSNCDsIkKzwR5JeFyj
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40