public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Cristian Rodríguez" <crrodriguez@opensuse.org>
To: Noah Goldstein <goldstein.w.n@gmail.com>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: Use adaptive mutex with std::mutex
Date: Sat, 29 Apr 2023 11:34:05 -0400	[thread overview]
Message-ID: <CAPBLoAeYYivyAzT9_dKsysw2ac_8Et3cs2CO=Wfr+3rz5njwbw@mail.gmail.com> (raw)
In-Reply-To: <CAFUsyf+sbpyS9cP8f8bHk0onX3pp5R2OBBMiNJLqBr3-MOUiNw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

On Wed, Apr 19, 2023 at 4:17 PM Noah Goldstein via Libc-alpha <
libc-alpha@sourceware.org> wrote:

> On Tue, Apr 18, 2023 at 4:37 PM H.J. Lu via Libc-alpha
> <libc-alpha@sourceware.org> wrote:
>
> i.e
> Futex = O(10^4) cycles
> Spin = O(10^2) cycles
>
> TIMED_NP Short Critical Section uses Futex: O(10^4) Cycles
> TIMED_NP Long Critical Section uses futex: O(10^4) Cycles
>
>
> ADAPTIVE_NP Short Critical Section uses spin: O(10^2) Cycles
> ADAPTIVE_NP Long Critical Section uses spin + futex: O(10^2) + O(10^4)
> = O(10^4) Cycles
>
>
>
If this is indeed the case.. Why is it not the default.. ? A quick read of
docs says  PTHREAD_MUTEX_INITIALIZER and PTHREAD_MUTEX_NORMAL are up to the
implementation to choose..

      reply	other threads:[~2023-04-29 15:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18 21:37 H.J. Lu
2023-04-19 20:16 ` Noah Goldstein
2023-04-29 15:34   ` Cristian Rodríguez [this message]

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='CAPBLoAeYYivyAzT9_dKsysw2ac_8Et3cs2CO=Wfr+3rz5njwbw@mail.gmail.com' \
    --to=crrodriguez@opensuse.org \
    --cc=goldstein.w.n@gmail.com \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    /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).