public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Yong <10walls@gmail.com>
To: Matteo Italia <matteo@mitalia.net>, gcc-patches@gcc.gnu.org
Cc: ebotcazou@adacore.com
Subject: Re: [PATCH] libgcc: fix Win32 CV abnormal spurious wakeups in timed wait [PR113850]
Date: Sat, 17 Feb 2024 00:24:52 +0000	[thread overview]
Message-ID: <9efd3727-c2c8-47a2-a534-a4b7f8c83351@gmail.com> (raw)
In-Reply-To: <53b85d35-e949-4412-bcfb-8b9bacf6b8ca@mitalia.net>

On 2/10/24 10:10, Matteo Italia wrote:
> Il 09/02/24 15:18, Matteo Italia ha scritto:
>> The Win32 threading model uses __gthr_win32_abs_to_rel_time to convert
>> the timespec used in gthreads to specify the absolute time for end of
>> the condition variables timed wait to a milliseconds value relative to
>> "now" to pass to the Win32 SleepConditionVariableCS function.
>>
>> Unfortunately, the conversion is incorrect, as, due to a typo, it
>> returns the relative time _in seconds_, so SleepConditionVariableCS
>> receives a timeout value 1000 times shorter than it should be, resulting
>> in a huge amount of spurious wakeups in calls such as
>> std::condition_variable::wait_for or wait_until.
>>
> Re-reading the commit message I found a few typos, and it was generally 
> a bit more obscure than I like; reworded it now, hope it's better.

Thanks, pushed to master and 13.x branches.

  reply	other threads:[~2024-02-17  0:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09 14:18 Matteo Italia
2024-02-10 10:10 ` Matteo Italia
2024-02-17  0:24   ` Jonathan Yong [this message]
2024-02-19 13:48     ` Matteo Italia
2024-02-19 13:55       ` Jonathan Yong

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=9efd3727-c2c8-47a2-a534-a4b7f8c83351@gmail.com \
    --to=10walls@gmail.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=matteo@mitalia.net \
    /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).