Liste des Groupes | Revenir à cl c++ |
On 10/17/2024 5:10 AM, jseigh wrote:There are fun things to do here. A thread can do an unlock lock cycle ever often, say 1000 iterations. The fun part is that this can beat a read write lock.I replaced the hazard pointer logic in smrproxy. It's now wait-freeFor some reason you made me think of another very simple proxy technique using per thread mutexes. It was an experiment a while back:
instead of mostly wait-free. The reader lock logic after loading
the address of the reader lock object into a register is now 2
instructions a load followed by a store. The unlock is same
as before, just a store.
>
It's way faster now.
>
It's on the feature/003 branch as a POC. I'm working on porting
it to c++ and don't want to waste any more time on c version.
>
No idea of it's a new algorithm. I suspect that since I use
the term epoch that it will be claimed that it's ebr, epoch
based reclamation, and that all ebr algorithms are equivalent.
Though I suppose you could argue it's qsbr if I point out what
the quiescent states are.
___________________
per_thread
{
std::mutex m_locks[2];
lock()
{
word ver = g_version;
m_locks[ver % 2].lock();
}
unlock(word ver)
{
m_locks[ver % 2].unlock();
}
}
___________________
The polling thread would increase the g_version counter then lock and unlock all of the threads previous locks. Iirc, it worked way better than a read write lock for sure. Basically:
___________________
word ver = g_version.inc(); // ver is the previous version
for all threads as t
{
t.m_locks[ver % 2].lock();
t.m_locks[ver % 2].unlock();
}
___________________
After that, it knew the previous generation was completed.
It was just a way for using a mutex to get distributed proxy like behavior.
Date | Sujet | # | Auteur | |
17 Oct 24 | smrproxy v2 | 66 | jseigh | |
17 Oct 24 | Re: smrproxy v2 | 41 | Chris M. Thomasson | |
17 Oct 24 | Re: smrproxy v2 | 40 | jseigh | |
18 Oct 24 | Re: smrproxy v2 | 39 | Chris M. Thomasson | |
18 Oct 24 | Re: smrproxy v2 | 2 | Chris M. Thomasson | |
18 Oct 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
18 Oct 24 | Re: smrproxy v2 | 36 | jseigh | |
26 Oct 24 | Re: smrproxy v2 | 35 | Chris M. Thomasson | |
26 Oct 24 | Re: smrproxy v2 | 34 | jseigh | |
27 Oct 24 | Re: smrproxy v2 | 33 | Chris M. Thomasson | |
28 Oct 24 | Re: smrproxy v2 | 32 | jseigh | |
28 Oct 24 | Re: smrproxy v2 | 28 | Chris M. Thomasson | |
28 Oct 24 | Re: smrproxy v2 | 27 | jseigh | |
28 Oct 24 | Re: smrproxy v2 | 26 | Chris M. Thomasson | |
28 Oct 24 | Re: smrproxy v2 | 25 | jseigh | |
28 Oct 24 | Re: smrproxy v2 | 24 | Chris M. Thomasson | |
29 Oct 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
29 Oct 24 | Re: smrproxy v2 | 22 | jseigh | |
29 Oct 24 | Re: smrproxy v2 | 3 | Chris M. Thomasson | |
29 Oct 24 | Re: smrproxy v2 | 2 | jseigh | |
29 Oct 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
29 Oct 24 | Re: smrproxy v2 | 5 | Chris M. Thomasson | |
29 Oct 24 | Re: smrproxy v2 | 4 | jseigh | |
29 Oct 24 | Re: smrproxy v2 | 3 | Chris M. Thomasson | |
30 Oct 24 | Re: smrproxy v2 | 2 | jseigh | |
1 Nov 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
29 Oct 24 | Re: smrproxy v2 | 13 | Chris M. Thomasson | |
30 Oct 24 | Re: smrproxy v2 | 12 | Chris M. Thomasson | |
30 Oct 24 | Re: smrproxy v2 | 11 | jseigh | |
4 Nov 24 | Re: smrproxy v2 | 10 | Chris M. Thomasson | |
4 Nov 24 | Re: smrproxy v2 | 9 | jseigh | |
4 Nov 24 | Re: smrproxy v2 | 3 | Muttley | |
4 Nov 24 | Re: smrproxy v2 | 2 | Chris M. Thomasson | |
9 Nov 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
12 Dec 24 | Re: smrproxy v2 | 5 | Chris M. Thomasson | |
12 Dec 24 | Re: smrproxy v2 | 4 | jseigh | |
12 Dec 24 | Re: smrproxy v2 | 3 | Chris M. Thomasson | |
13 Dec 24 | Re: smrproxy v2 | 2 | jseigh | |
26 Dec 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
28 Oct 24 | Re: smrproxy v2 | 3 | Chris M. Thomasson | |
28 Oct 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
28 Oct 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
29 Oct 24 | Re: smrproxy v2 | 4 | Chris M. Thomasson | |
30 Oct 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
30 Oct 24 | Re: smrproxy v2 | 2 | Chris M. Thomasson | |
30 Oct 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
30 Oct 24 | Re: smrproxy v2 | 2 | Chris M. Thomasson | |
30 Oct 24 | Re: smrproxy v2 | 1 | jseigh | |
2 Nov 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
21 Nov 24 | Re: smrproxy v2 | 17 | jseigh | |
23 Nov 24 | Re: smrproxy v2 | 16 | jseigh | |
23 Nov 24 | Re: smrproxy v2 | 3 | Chris M. Thomasson | |
24 Nov 24 | Re: smrproxy v2 | 2 | jseigh | |
24 Nov 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
24 Nov 24 | Re: smrproxy v2 | 12 | jseigh | |
25 Nov 24 | Re: smrproxy v2 | 7 | Chris M. Thomasson | |
25 Nov 24 | Re: smrproxy v2 | 6 | jseigh | |
25 Nov 24 | Re: smrproxy v2 | 2 | Chris M. Thomasson | |
25 Nov 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
25 Nov 24 | Re: smrproxy v2 | 3 | Chris M. Thomasson | |
25 Nov 24 | Re: smrproxy v2 | 2 | jseigh | |
26 Nov 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson | |
27 Nov 24 | Re: smrproxy v2 | 4 | jseigh | |
9 Dec 24 | Re: smrproxy v2 | 3 | jseigh | |
11 Dec 24 | Re: smrproxy v2 | 2 | jseigh | |
12 Dec 24 | Re: smrproxy v2 | 1 | Chris M. Thomasson |
Les messages affichés proviennent d'usenet.