220 41277 <992426dc-b7a7-2ffa-2937-8f362593c8e8@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Robin Rowe <robinsrowe@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Multi-processing SharedMemory, Semaphore and
 RingBuffer classes
Date: Sat, 22 Dec 2018 00:19:28 -0800
Lines: 78
Approved: news@gmane.org
Message-ID: <992426dc-b7a7-2ffa-2937-8f362593c8e8@gmail.com>
References: <84ce0721-ed7b-85cf-5434-1b8eb153ddab@gmail.com>
 <0ba51187-1ea5-4e75-978f-802f2d52cc59@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"; format=flowed
X-Trace: blaine.gmane.org 1545466647 24843 195.159.176.226 (22 Dec 2018 08:17:27 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 22 Dec 2018 08:17:27 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101
 Thunderbird/60.3.3
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCUOVZFOBEIJHZ7X4ACRUBERQGMSG@isocpp.org Sat Dec 22 09:17:23 2018
Return-path: <std-proposals+bncBCUOVZFOBEIJHZ7X4ACRUBERQGMSG@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf1-f199.google.com ([209.85.210.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCUOVZFOBEIJHZ7X4ACRUBERQGMSG@isocpp.org>)
	id 1gacTK-0006Hf-Ox
	for gclcip-std-proposals@m.gmane.org; Sat, 22 Dec 2018 09:17:22 +0100
Original-Received: by mail-pf1-f199.google.com with SMTP id r9sf7202384pfb.13
        for <gclcip-std-proposals@m.gmane.org>; Sat, 22 Dec 2018 00:19:33 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1545466772; cv=pass;
        d=google.com; s=arc-20160816;
        b=XofXYnqVrVXARoXl+g01hQchupESxzDFTi5tWgoaPIpZq6Nw4K4rNbkJbOAELxL0R/
         kGcgyDqW727deFtjhKzK6T6wzwGV2Y4Xus/w+Vz2d2ExZJJwOb3XrFQ5y4rMT/5P8236
         OEGeozy8jvVPl0dyofeSe/JjMbJWK5NxCGdwLxj1heA3DxeRY/5Oxax7IsCejJdmZx3o
         mqMBwIgAeF8dtD3hv5asPxfz5/PwJTUN01Visz6Nusum0uzIU8sWi3/z23Q0RzmjkhSv
         /gJBl+AmF1Qa2sNpDWYvrakxMskdwM0MHyR17wU2vwj6CEce1ilsy4b2zlDMcXHAPr32
         j3WQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:content-language
         :in-reply-to:mime-version:user-agent:date:message-id:from:references
         :to:subject:dkim-signature;
        bh=0+YlbQeLaxfZDCosnGV/91MwwpT9Lif7lF+skejDgqs=;
        b=wI27zZ8/oFb1vJ10YcMAe5d8xEEv0huddKHVKHshRf6RyNE9ixBBpOjW2pkExrfdqk
         eJBDMu60gYwSEh0mf3cwWwSjX1EOrOwJJwhXPd5P8HzSyY/+RTwV/mNMILQyCF6QEEpi
         kXEHRAx3rNqfzEDOd2mHOQZhH5971TyUmyJw2xDF/z1siS2OvTN3eSqz1eiOdZ7x0wxP
         HIX7nDxZBd/Jewjid8MWoVjA1hsX0Oxr7W6FJMI4sPfN7lr856vXI7OTwFVOSDkhMMd5
         72LqDSES0YMiIzMXg5Kuzdh9t+iSVEtIDGW4yv3S2s60DtAn4uj6UDLJeNR2ZX+0lPf+
         J1Og==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sn79q8B9;
       spf=pass (google.com: domain of robinsrowe@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=robinsrowe@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:from:message-id:date:user-agent:mime-version
         :in-reply-to:content-language:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=0+YlbQeLaxfZDCosnGV/91MwwpT9Lif7lF+skejDgqs=;
        b=IdmtwtWlL0hecsQwH2nRsPXSnv38uZ8wfrZXdTojZl7iFP9TUaIikyh8698ZOfPazI
         9eZa8WHHzd1P1LSTX2l5Vfb2qe39jFucLdcui/Ke5yB9/ihCVW4KJWD/oFP+xdOJV9AI
         JfnSIYKy2fp8aK+2HU6Lj9E1Uziv50v1c0j5aO0hIyb+T+8V1dGqebSstv6bMaTxhpQe
         NXkmOI40zbEGqO6d9SpQKjLZo/k59WnZO7c6a/TcQJnRjA/+TsEgMY9djBtfOS6luS5C
         QgaMGYgogB50nry7aC1wMsbudA3grDtTZgd11p8x9h3g/ugHGldGqdJHKD2U75nVjfLD
         cxmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-to:content-language
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=0+YlbQeLaxfZDCosnGV/91MwwpT9Lif7lF+skejDgqs=;
        b=NbWxazMv9JegVz8JIpqwSzogTUk0gIpY/2TMG0PLHYNg1FZ5dVD8YtMoASYF6e5viI
         rkfWBM0dQDjkMjUddsKsVbJ4eFrmkuVcTmYP04wnT2W85VvY39Mxt2kCDGkcKNCgq3u4
         QN6rvzmDmjFUT1el24XCSmIIWFk1QOFT4zOuXI0r9KIjUMvCsY79YSSwhvrE7oLfpY9A
         +a//h2wXdM3HUetB/iDPLKtTJq2tR0wDMdsL5OxoK3A3Zi5vzPDft65vYNQ5xpLA1+kJ
         u5xtWkmuPJIlbhUrLtZaFQTEl5tB71vLW54QWyc+nvoLBDkYr9tR+uNVz3GBPOTyirhr
         u 
X-Gm-Message-State: AJcUukey/YB2AebtZEPWHbHIwNlNw/t9t3tijU6caUkoQa+C10adPeK6
	tF/CgN/kloYgnjr8ey+YPXk7IQ==
X-Google-Smtp-Source: ALg8bN4Y/Ev6D6oCs/QU3+DVda+U+NB8DR+zyafrt3jLbwcIj3ZR09tE8mKndYf9M8AJxY8xBMQ8mQ==
X-Received: by 2002:a17:902:8681:: with SMTP id g1mr2182642plo.38.1545466772638;
        Sat, 22 Dec 2018 00:19:32 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a62:124f:: with SMTP id a76ls2239784pfj.1.gmail; Sat, 22 Dec
 2018 00:19:31 -0800 (PST)
X-Received: by 2002:a63:5320:: with SMTP id h32mr5381320pgb.414.1545466771352;
        Sat, 22 Dec 2018 00:19:31 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1545466771; cv=none;
        d=google.com; s=arc-20160816;
        b=oqT5bYmfqaN5PPTO3kunkbuIOMsPVGU1iKIJcoVvxYcJf38Scp4O4vfzlk6cBzg7hY
         O0MmPjZOJbkHEEKRVpdd/jI8VsXR9zlt9YrhM4Qo1FBTJO+hn3HKyBxYgl2ljjt49NTV
         pcDLDEcQks75UjBRt0NkmuacokP7bb1a3zrGtOOdJqj5mRxlEMlE6yKMgTmcpe5eN7g6
         jVIynoGmssEWmrUQ4I8AEla3gzpVb+1JJO6tbz53e1hBPY/DWSHjvQWDB7VT0hrkqk8M
         unVbm73dQtzskoDJ8Lr3dTdZVmoMb3z5HYHmZegIXhz7+6yvjvZSK4tphOlTt2lhU9Nz
         z3Tg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:content-language:in-reply-to:mime-version
         :user-agent:date:message-id:from:references:to:subject
         :dkim-signature;
        bh=vsPsQhjInI/R0dtQlKo3e/m1OR4MgwraleOi2Yvb2BQ=;
        b=YD7rEGcp8AuulVPX7VcM8GNa8iPUIyA6OPaxBt6F57e0BFOk6rxjMhBbiBWamSuVXb
         nVgFJlRSQBl0WugBhVbk3as/KcLnL6ACkexm4D94GLs6DU/CM8wLMgFOlYaEcizubTm5
         G/lqil3NkWkjsLFHMHtgrFE1BllPPR0qhcaeip/FIX18toSn6xy8cpOMgf/y3pLf1VOb
         E6XDMMv9FyZzVD9qTzQ24B7rHJtAkce2KfXVjX+8yHbl1OLYPHJMMltE5udEzLEIwdSj
         ejCJseQVWgEuZXo0C2Bz8KJX5s4/FCaPwUhtVQgYQ4DO72l0N8h4JabvKA1FdElZHuLO
         MBgA==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sn79q8B9;
       spf=pass (google.com: domain of robinsrowe@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=robinsrowe@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id u69sor44790422pfa.13.2018.12.22.00.19.31
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Sat, 22 Dec 2018 00:19:31 -0800 (PST)
Received-SPF: pass (google.com: domain of robinsrowe@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a62:d885:: with SMTP id e127mr5623818pfg.197.1545466770646;
        Sat, 22 Dec 2018 00:19:30 -0800 (PST)
Original-Received: from [192.168.1.122] (cpe-23-242-20-216.socal.res.rr.com. [23.242.20.216])
        by smtp.googlemail.com with ESMTPSA id 85sm37623342pfw.17.2018.12.22.00.19.29
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sat, 22 Dec 2018 00:19:29 -0800 (PST)
In-Reply-To: <0ba51187-1ea5-4e75-978f-802f2d52cc59@isocpp.org>
Content-Language: en-US
X-Original-Sender: robinsrowe@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=Sn79q8B9;       spf=pass
 (google.com: domain of robinsrowe@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=robinsrowe@gmail.com;       dmarc=pass
 (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:41277
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/41277>

Arthur,

Thanks for catching me up on the history of previous ring queue attempts 
and code links. Interesting. Very helpful!

Is there anyone who can also share what's come before for MP shared 
memory and semaphores?

 > Just so you have the right frame for however this thread develops. :)

No expectations. I only seek to be useful.

 > Guy Davidson is still somewhat pursuing P0059 ring-buffer-related
 > work, but I'm not.

Guy, if you're available here, can you share your thoughts?

 > Ring-buffers are like Concepts or Modules: everyone wants "a standard
 > ring-buffer type," but everyone thinks it means something slightly
 > different, such that nobody would actually be happy with the finished
 > product. Should it be thread-safe or thread-unsafe?

Common practice suggests nobody sees a benefit to embedding locks in 
containers generally. A container should be thread-unsafe or lockfree, 
have external locks or not need locks. Because lockfree container 
performance is so poor generally, slower than thread-unsafe containers 
with external locks, let's set lockfree aside until we can show it works 
better. That leaves just one choice: thread-unsafe.

 > Should it own or not own its buffer?

Because my ring buffer is in MP shared memory, it better own its data.

 > Should it be resizeable (and thus heap-allocated and
 > allocator-aware) or statically sized in-place?

The typical use-case for a ring queue is for a communications buffer 
between threads or processes. We won't want that to be resizable or to 
try heap allocations during a real-time service request. Moreover, if 
for some reason we do decide we want a container like that, we already 
have the resizable and heap-based std::queue.

 > Your library chooses "thread-unsafe, owning, in-place."

Yes, no other approach seems sensible for MP. With our use-case a comms 
buffer, that must work in a multi-processing or multi-threaded 
environment. To ensure not only the buffer but the apparatus of the 
container are in shared memory, "owning and in-place" seem the only way 
to go. Embracing the constraints of MP seems to force other slightly 
different solutions to fall away.

 > You should consider posting on codereview.stackexchange.com to get
 > specific library feedback.

Thanks, implementation is still fresh. While I deeply appreciate your 
feedback, I won't take the bandwidth of this list for code review. Will 
follow up with you off-list.

The feedback I'm seeking now is opinions of whether this is the right 
track toward a standard. Can this design overcome all the objections to 
previous efforts to standardize a ring queue and MP shared memory?

https://github.com/robinrowe/multiprocessing

Thanks!

Robin
-- 
Robin Rowe
323-535-0952 mobile
Beverly Hills, California

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/992426dc-b7a7-2ffa-2937-8f362593c8e8%40gmail.com.

.
