From: "Александр Маликов" <schn27@gmail.com>
To: cygwin-patches@cygwin.com, Aleksandr Malikov <schn27@gmail.com>
Subject: Re: [PATCH] fix race condition in List_insert
Date: Mon, 23 Aug 2021 18:48:21 +0300 [thread overview]
Message-ID: <CAGdYWrY=tydw+Bu_dYVef_enUh-_ndBC4kQGUgfL=D6AZuqb+Q@mail.gmail.com> (raw)
In-Reply-To: <YSO4hmZcdL/5w44q@calimero.vinschen.de>
https://gist.github.com/schn27/23b47563b429aaaad5ac315d05a43a11
The test is failed if "Thread #X timeout" is printed and -1 returned. This
happens on my laptop in about several minutes.
The test is passed if it runs infinitely.
пн, 23 авг. 2021 г. в 18:02, Corinna Vinschen <corinna-cygwin@cygwin.com>:
> Hi Aleksandr,
>
>
> thanks for the patch.
>
> On Aug 23 17:27, Aleksandr Malikov wrote:
> > From: Aleksand Malikov <schn27@gmail.com>
> >
> > Revert mx parameter and mutex lock while operating the list.
> > Mutex was removed with 94d24160 informing that:
> > 'Use InterlockedCompareExchangePointer to ensure race safeness
> > without using a mutex.'
> >
> > But it does not.
> >
> > Calling pthread_mutex_init and pthread_mutex_destroy from two or
> > more threads occasionally leads to hang in pthread_mutex_destroy.
>
> Do you have a simple testcase in plain C, by any chance?
>
> > To not change the behaviour of other cases where List_insert was called,
> > List_insert_nolock is added.
>
> LGTM. Can you please provide a copyright waiver per
> https://cygwin.com/contrib.html. See the winsup/CONTRIBUTORS file.
>
>
> Thanks,
> Corinna
>
next prev parent reply other threads:[~2021-08-23 15:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-23 14:27 Aleksandr Malikov
2021-08-23 15:02 ` Corinna Vinschen
2021-08-23 15:48 ` Александр Маликов [this message]
2021-08-23 18:08 ` Corinna Vinschen
2021-08-23 19:05 ` Александр Маликов
2021-08-24 7:57 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGdYWrY=tydw+Bu_dYVef_enUh-_ndBC4kQGUgfL=D6AZuqb+Q@mail.gmail.com' \
--to=schn27@gmail.com \
--cc=cygwin-patches@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).