From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128502 invoked by alias); 18 Feb 2020 14:31:15 -0000 Mailing-List: contact libstdc++-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libstdc++-owner@gcc.gnu.org Received: (qmail 128440 invoked by uid 89); 18 Feb 2020 14:31:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=unavailable version=3.3.1 spammy=H*i:sk:110487c, H*f:sk:110487c, H*MI:sk:110487c X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (207.211.31.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Feb 2020 14:31:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582036261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GhGSvj8+bAwnjeufegbrU2J10T+Lv2VHLHPQ4Td2O54=; b=HjdIB5xhaQoYBMabxZQTJiSJPeTwCPD4ASD8QFA8c7HbGdX7/TzzVzTPuchd30i1NVJVZi Om3Ubmy+MqunOw1n5GPzye54Z5+Yk8jXNJP2iOx63iqTUQCE71OPcqOdHTtxJ2aA2DJg2s HC8vYU2R2DKI5XmFqrGdOBaWcAKaBm4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-81-SGuO9SWjNku76pAggri7xA-1; Tue, 18 Feb 2020 09:30:57 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B0E1801E5C; Tue, 18 Feb 2020 14:30:56 +0000 (UTC) Received: from localhost (unknown [10.33.36.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DFE790773; Tue, 18 Feb 2020 14:30:55 +0000 (UTC) Date: Tue, 18 Feb 2020 14:31:00 -0000 From: Jonathan Wakely To: Sebastian Huber Cc: Thomas Rodgers , gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [PATCH] Add c++2a binary_semaphore Message-ID: <20200218143055.GE9441@redhat.com> References: <1291008602.5930779.1582008369882.JavaMail.zimbra@redhat.com> <110487c1-e3f7-09c3-f6e7-93ede1239828@embedded-brains.de> MIME-Version: 1.0 In-Reply-To: <110487c1-e3f7-09c3-f6e7-93ede1239828@embedded-brains.de> X-Clacks-Overhead: GNU Terry Pratchett X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00109.txt.bz2 On 18/02/20 14:48 +0100, Sebastian Huber wrote: >Hello, > >On 18/02/2020 07:46, Thomas Rodgers wrote: >>This patch adds the c++2a semaphore header and binary_semaphore type. The= implementation is not complete, this patch is just to solicit initial feed= back. > >how do you plan to implement the binary semaphores? For example, do=20 >you want to add the binary semaphores to gthr.h or via a mutex and a=20 >condition variable or via some futex stuff? I ask because I would like=20 >to support this in RTEMS. Futexes where possible. Using POSIX semaphores might be a good alternative for the std::counting_semaphore type, but for std::binary_semaphore we talked about just using a spinlock based on std::atomic.