Sujet : Re: Futexes ain't fast
De : chris.m.thomasson.1 (at) *nospam* gmail.com (Chris M. Thomasson)
Groupes : comp.lang.c++Date : 15. Sep 2024, 01:24:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vc59fd$1o4dp$7@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
On 8/30/2024 5:36 PM, jseigh wrote:
On 8/30/24 15:45, Chris M. Thomasson wrote:
On 8/30/2024 6:31 AM, jseigh wrote:
...
>
They don't have to be fast, they just have to allow correct synchronization
and allow performant fast paths. Can the api be improved for the latter?
Certainly yes. It is an awkward api to use.
>
100% agreed. Eventcounts are in the mix as well.
>
You might take a look at folly's eventcount. It (I think) only calls
futex wake if there are waiters, and only calls futex_wait if the
eventcount hasn't been incremented. I did my own C version since I'm
working in C for now.
Humm... Sounds interesting. I might have some more time tonight. Working on an interesting collision avoidance algorithm right now using one of my field algorithms. Remember that old eventcount algo of mine I was tinkering with way back in c.p.t? You said the membars are no so pretty...