From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by sourceware.org (Postfix) with ESMTPS id 0E39B3886C6C for ; Mon, 7 Jun 2021 13:30:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0E39B3886C6C Received: by mail-qt1-x82c.google.com with SMTP id m13so12519656qtk.13 for ; Mon, 07 Jun 2021 06:30:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=glJaWXXkso8vIPpAGo9MhpWteO+TNoHD0jfAKtb1WGo=; b=rFfa2tH9/4m/pP3kIg1geTTjm1TS3OlzWfy4O0xYfI0x95jv9ZVv0XRFwNPkpC7ccQ pPVfKS1OM+Dp8evKtk6cnaGIoCLVryx/LDIY1fFxr72W+yJN9hXCRGzgH4gkdEeS+Jjv ZYWVXqdEsYhifacbGgd3fKmX5PBE7xie7AKhhwsbOV86xwF6Am0NEYUYl6qXj+EHhTxb hJ8EIqZwfmTIZxuf/MJmPoCQNfeVs7scMrf6aEKweR5HeoMTOwEy5mzZnxpuUuSISxni WrUQ54Vn3DjR7weHSNqDebSsXm44KmVBRaJXyGi6LN6Ec+wSZkwC/Gk0QLPk2pKxaUWE ZCzw== X-Gm-Message-State: AOAM531BszxZ0fG8PAt4tOhwLtFB+0ZtYr7BN+OqjogJAaqMSz7Ubxvw 9FGH9tlI6DeE6Hkh3JC5fL4EvNexb7EiNUeg448vtN4B+8W6VQ== X-Google-Smtp-Source: ABdhPJyVqnwm+Y/Y4o27f9putb3TauINcQdk8f4ZpV89HVRl2k+znf0A4zw8Ng37MzUilj1mY/aK4g09wJfKd7GwJAo= X-Received: by 2002:ac8:43d6:: with SMTP id w22mr16236553qtn.209.1623072646649; Mon, 07 Jun 2021 06:30:46 -0700 (PDT) MIME-Version: 1.0 From: dumblob Date: Mon, 7 Jun 2021 15:30:30 +0200 Message-ID: Subject: glibc pthreads and optimized locks To: libc-help@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 13:30:57 -0000 Dear glibc experts, Does anybody know whether glibc pthreads implement the fast lock algorithms as https://github.com/AlexeyAB/object_threadsafe does? A detailed description of these algorithms is in https://www.codeproject.com/Articles/1183423/We-Make-a-std-shared-mutex-10-Times-Faster and some more optimizations in https://www.codeproject.com/Articles/1183446/Thread-safe-std-map-with-the-speed-of-lock-free-ma . Btw. I'm aware these articles discuss C++, but the same principles apply to locks in C. I'm asking because pthreads are known to be rather slower in general and if such optimized variants of locks are not implemented, I'll propose implementing them in few specific apps which would benefit from the optimizations (e.g. the main implementation of the V language). Thanks, dumblob