🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Fwd: Why ordered mutexed don't work ...

#1093
From: Tristan Wibberley
Date: Wed, 02 Dec 2026 19:02
39 lines
3273 bytes
On 02/12/2026 11:58, Bonita Montero wrote:
> 
> 
> 
> -------- Weitergeleitete Nachricht --------
> Betreff: Why ordered mutexed don't work ...
> Datum: Wed, 2 Dec 2026 12:58:25 +0100
> Von: Bonita Montero <Bonita.Montero@gmail.com>
> Organisation: A noiseless patient Spider
> Newsgruppen: comp.lang.c
> 
> Just for fun, I tried writing a mutex today that wakes up threads
> in the same order they began waiting. I thought I was finished, but
> while cycling into the old town for a meal, it occurred to me: I can
> control the order in which threads start waiting, but I cannot control
> the order in which the scheduler wakes them up. Furthermore, if there
> isn’t a free CPU core available, there’s no guarantee that a thread
> will be woken up immediately. Once I got home, well-fed, I deleted
> the entire project.
> In any case, no operating system offers such mutexes, and runtime
> environments don’t provide them either. I suspect I’m not the first
> person to come up with this idea.

The scheduler can switch among them at any time, including before any
side-effects happen. One need to use co-operative multi-threading which
is available and has been since before I was born.

-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Technical Details
Message-ID: <11epq00$3db0e$2@dont-email.me>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11ep150$2vi4k$1@raubtier-asyl.eternal-september.org> <11ep15v$2vi4k$3@raubtier-asyl.eternal-september.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk>
Newsgroups: comp.lang.c++
Subject: Re: Fwd: Why ordered mutexed don't work ...
Date: Wed, 2 Dec 2026 19:02:24 +0000
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <11epq00$3db0e$2@dont-email.me>
References: <11ep150$2vi4k$1@raubtier-asyl.eternal-september.org>
 <11ep15v$2vi4k$3@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 02 Dec 2026 19:02:25 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3582990"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/i5JZcocYN5kHK3SL4mJIeByhWHuUNlqYGeOU+jaMnUA=="; posting-host="32b5c3263f4da7d036805a857de019db"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:r6Lp04+sgWImhcK1zEi6A5j7+RU= sha256:uj9BV0r/70Otaq3GqsIE0/MlO5K4RPb/L8tGeuiqVrU=
	sha1:pdcdgzl81p4rGo8gZczwzDyhN8M= sha256:uW50uaVof1Uv7RNtFcNHcAmJpQZDPiNuSoU1x608G1E=
Content-Language: en-GB
In-Reply-To: <11ep15v$2vi4k$3@raubtier-asyl.eternal-september.org>