|
Message-ID: <CAOZ3c1pvia0_BabcKoJjP5GbZH7k8xHSa_CzLBvSJOskYfeabQ@mail.gmail.com>
Date: Mon, 28 Feb 2022 14:43:36 +0000
From: Lee Shallis <gb2985@...il.com>
To: musl@...ts.openwall.com
Subject: Re: Suggestion for thread safety
Seems the wait just wasn't long enough, at about 4 yields onwards the
results become consistent success, I've attached the file I did the
experiments in, I even tried it under -O3 and no exits were
encountered, so yes my method works, just needs a bit more wait time
for extreme cases
On Mon, 28 Feb 2022 at 08:48, Joakim Sindholt <opensource@...sha.com> wrote:
>
> On Sun, 27 Feb 2022 23:32:47 +0000, Lee Shallis <gb2985@...il.com> wrote:
> > Yes, as I mentioned before, pauseCB is supposed to have it's pointer
> > be changed by the developer, in other words you forgot to plugin a
> > pthreads compatible call prior to your threads starting, considering
> > you made that mistake I suppose it is a good thing I since switched to
> > a non-redirectable pointer:
>
> How many times do you want to do this?
>
> zhasha@...belwind /home/zhasha ; gcc -D_GNU_SOURCE -lpthread buglock.c
> zhasha@...belwind /home/zhasha ; ./a.out
> var = 1, expected 0
> zhasha@...belwind /home/zhasha ; ./a.out
> var = 1, expected 0
> zhasha@...belwind /home/zhasha ; ./a.out
> var = 1, expected 0
> zhasha@...belwind /home/zhasha ; ./a.out
> var = 1, expected 0
> zhasha@...belwind /home/zhasha ; ./a.out
> var = 1, expected 0
> var = 2, expected 1
> zhasha@...belwind /home/zhasha ; ./a.out
> var = 1, expected 0
> var = 2, expected 1
View attachment "lock.c" of type "text/x-csrc" (1725 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.