🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Fwd: futexes vs. system semaphores

#1124
From: Chris M. Thomasson
Date: Fri, 04 Dec 2026 22:46
72 lines
4702 bytes
On 12/3/2026 9:19 PM, Bonita Montero wrote:
> Here, I've run the numbers.
> 
> Windows:
> 
> 2:      ftx:    491     fst:    565     1.15x
> 3:      ftx:    4074    fst:    11991   2.94x
[...]
> 32:     ftx:    2252672 fst:    2133722 0.95x
> 
> My semahore under Windows has mostly the same performance or
> with two contenders slightly better and with three contenders
> three times the performance of that junk you linked - with a
> much simpler implementation.

Its not junk. Look at 32 threads, getting there!


> Linux:
> 
> 2:      ftx:    1456    fst:    39363   27.04x
> 3:      ftx:    95616   fst:    96985   1.01x
> 4:      ftx:    168584  fst:    170464  1.01x
> 5:      ftx:    270214  fst:    273245  1.01x
> 6:      ftx:    373839  fst:    375453  1x
> 7:      ftx:    538606  fst:    534535  0.99x
^^^^^^^^^^^^

Wow! Keep in mind that you should run each test say ten times and gain 
an average.



> 8:      ftx:    673492  fst:    683807  1.02x
> 9:      ftx:    898650  fst:    894311  1x
> 10:     ftx:    1083584 fst:    1055793 0.97x
> 11:     ftx:    1328219 fst:    1313164 0.99x
> 12:     ftx:    1545355 fst:    1524119 0.99x
> 13:     ftx:    1894798 fst:    1849783 0.98x
> 14:     ftx:    2131777 fst:    2094171 0.98x
> 15:     ftx:    2516374 fst:    2500234 0.99x
> 16:     ftx:    2828323 fst:    2803388 0.99x
> 17:     ftx:    3174866 fst:    3313779 1.04x
> 18:     ftx:    3573553 fst:    3570326 1x
> 19:     ftx:    4011282 fst:    4078527 1.02x
> 20:     ftx:    4405248 fst:    4391922 1x
> 21:     ftx:    4962228 fst:    4935942 0.99x
> 22:     ftx:    5435345 fst:    5387555 0.99x
> 23:     ftx:    5965102 fst:    5954236 1x
> 24:     ftx:    6433429 fst:    6421140 1x
> 25:     ftx:    7085701 fst:    6996433 0.99x
> 26:     ftx:    7655770 fst:    7559600 0.99x
> 27:     ftx:    8179374 fst:    8096742 0.99x
> 28:     ftx:    8645022 fst:    8661534 1x
> 29:     ftx:    9385330 fst:    9426123 1x
> 30:     ftx:    9995952 fst:    9946090 1x
> 31:     ftx:    1.054562e+07    fst:    1.05073e+07     1x
> 32:     ftx:    1.126328e+07    fst:    1.132129e+07    1.01x
> 
> Under Linux that's similar but with two contenders it
> has 27 times the performance of the code you linked.

They start to get similar numbers under more load. Humm. Thanks! Keep in 
mind that a benaphore is old. But strange that it still gets similar 
numbers on higher load.


> You know, kid, you don’t understand a thing,
> yet you can get all worked up over nonsense.

lol. Can you post your test bench code for this so I can run it as well?
Technical Details
Message-ID: <11evfsv$24lgp$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11duih8$sm6c$1@raubtier-asyl.eternal-september.org> <11duq79$vfpt$1@raubtier-asyl.eternal-september.org> <11er4jp$10h0$1@raubtier-asyl.eternal-september.org> <11esnho$s9c7$2@dont-email.me> <11eso4p$sn9c$1@raubtier-asyl.eternal-september.org> <11esqj0$tq1m$1@dont-email.me> <11etgq6$15mq0$1@raubtier-asyl.eternal-september.org> <11etihk$1671l$1@raubtier-asyl.eternal-september.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups: comp.lang.c++
Subject: Re: Fwd: futexes vs. system semaphores
Date: Fri, 4 Dec 2026 14:46:52 -0800
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <11evfsv$24lgp$1@dont-email.me>
References: <11duih8$sm6c$1@raubtier-asyl.eternal-september.org>
 <11duq79$vfpt$1@raubtier-asyl.eternal-september.org>
 <11er4jp$10h0$1@raubtier-asyl.eternal-september.org>
 <11esnho$s9c7$2@dont-email.me>
 <11eso4p$sn9c$1@raubtier-asyl.eternal-september.org>
 <11esqj0$tq1m$1@dont-email.me>
 <11etgq6$15mq0$1@raubtier-asyl.eternal-september.org>
 <11etihk$1671l$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 04 Dec 2026 22:46:56 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2250265"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/dSpwXohNzXao4IO74SJhUijzuBjcd+jU="; posting-host="b19a3c9bc26d9213a9f72d10babaa512"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:YKcsh/O91X7ZAA26bfeFd6j9W9E= sha256:Ra9qo/x7A/ta7C/XB3gb4vlgRaM8pl8ICiu6RJCaw0k=
	sha1:QviWVRyD0fya1yKQ00+qSo5H3UE= sha256:wXt3RcXdplWq7iVCVJCvuG+etu1naCd07c/zlSXC7Ak=
In-Reply-To: <11etihk$1671l$1@raubtier-asyl.eternal-september.org>
Content-Language: en-US