220 17312 <74b7204a-18b6-40fd-aa0e-ec3946688272@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Zijie He <hzj_jie@hotmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Generic Parallel Computing (GPC) API
Date: Fri, 10 Apr 2015 08:03:27 -0700 (PDT)
Lines: 457
Approved: news@gmane.org
Message-ID: <74b7204a-18b6-40fd-aa0e-ec3946688272@isocpp.org>
References: <3be1928f-2116-4712-be20-7368682abf26@isocpp.org>
 <81e0ac7b-2e97-4ecc-8c37-c9851be3d81c@isocpp.org>
 <45d4c30d-72b4-474a-9df6-9efa17d4d0b1@isocpp.org>
 <2000ef45-bc5b-4453-8252-d78c7406afc8@isocpp.org>
 <363fb8c3-5127-47c4-8a08-c6b4202809c6@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1195_964796084.1428678207536"
X-Trace: ger.gmane.org 1428678248 21563 80.91.229.3 (10 Apr 2015 15:04:08 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 10 Apr 2015 15:04:08 +0000 (UTC)
Cc: tef@tentity.com
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD6IXSMN7QKRBQGMT6UQKGQECOZIAUI@isocpp.org Fri Apr 10 17:03:58 2015
Return-path: <std-proposals+bncBD6IXSMN7QKRBQGMT6UQKGQECOZIAUI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f199.google.com ([209.85.220.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBD6IXSMN7QKRBQGMT6UQKGQECOZIAUI@isocpp.org>)
	id 1YgaT6-00020m-QO
	for gclcip-std-proposals@m.gmane.org; Fri, 10 Apr 2015 17:03:41 +0200
Original-Received: by qkmm15 with SMTP id m15sf29843469qkm.1
        for <gclcip-std-proposals@m.gmane.org>; Fri, 10 Apr 2015 08:03:29 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:content-type:x-original-sender
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=JKOUYFDeHoGKyxmxctuUZBM5osrYFfSCftZmElierzk=;
        b=k3fsdEAWI9CHeHA8CnyTMUnnfODPHJ1lfs18342Aod1QOvEk8XxkNYLLa86+1seB0r
         tC9LJ/VejZWMeyRKh4Euk4j8ZQX7qjqRJePhfvwsFSCOWQZobohk9yQVk8TEMooqukqn
         KxYZqmdxHzfg70/zYpzVN1WcRmtsMHkQRu4mnz28lIqnkXQ+nm9cPtw7As5ELWHC7Rs0
         2MGk1qjRfyiKUNO9viO3n/BMfA260c4tSFOwgS6rj3ya1CQ9mNOSIvjU6cheiPoKUOj/
         uxYfoGbvSNYjboqbSpnt2kDIl9pSniY/XYvgzMWWavqo60cgJQYc0wAuRKpp4dnVXnqX
         oPuA==
X-Gm-Message-State: ALoCoQnN918XjlHFnlnSnFMSihLEHvWMsirn7QxSSjAJ+hbrvILLuzNAnKo8UINuODGzBB9syhIa
X-Received: by 10.236.32.6 with SMTP id n6mr2136014yha.1.1428678209527;
        Fri, 10 Apr 2015 08:03:29 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.170.80 with SMTP id t77ls1396082ioe.21.gmail; Fri, 10 Apr
 2015 08:03:28 -0700 (PDT)
X-Received: by 10.50.51.67 with SMTP id i3mr60165igo.15.1428678208603;
        Fri, 10 Apr 2015 08:03:28 -0700 (PDT)
In-Reply-To: <363fb8c3-5127-47c4-8a08-c6b4202809c6@isocpp.org>
X-Original-Sender: Hzj_jie@hotmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:17312
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/17312>

------=_Part_1195_964796084.1428678207536
Content-Type: multipart/alternative; 
	boundary="----=_Part_1196_1826248938.1428678207536"

------=_Part_1196_1826248938.1428678207536
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Single consumer queue is not good for modern hardware, at least we need to=
=20
have one thread i.e. one consumer per core.

For the parallel computational model, I was working on .Net before, and was=
=20
using lambda expressions to define the order of steps,
imaging,

auto x =3D define_a_procedure(
[]() {
.... do some processor work ...
waitfor(an_io_or_lock); // the lock here is not the common lock
goto_next_step();
},
[]() {
.... obtained the lock or io operation finished ...
.... do some processor work ...
goto_finish();
});
run(x); // non-blocking
And each step may work on different threads, the whole procedure will not=
=20
stop until goto_finish() involved.
But when porting to c++, issues as the lifetime of the procedure, it should=
=20
keep alive until goto_finish(), and meanwhile, the most important thing is,=
=20
if we need to refer some local variables <which is the reason to use lambda=
=20
expressions>, we also need to consider the lifetime of these variables. I=
=20
tried to use shared_ptr everywhere, but still have some trouble.

On Sunday, April 5, 2015 at 7:39:15 AM UTC+8, t...@tentity.com wrote:
>
> Let me make some clarification.
> In my system, I have one thread pool for everything: forks, joins, http=
=20
> requests, timers, etc.
> I avoid creating threads (that is why I do not use std::async) and I avoi=
d=20
> switching threads.
> I don't see any reason to have more than one thread per core (20 years ag=
o=20
> I would do because it was only one core CPU, but not now).=20
> So, I do not create a thread pool per a qutex, but I use one thread pool=
=20
> for everything.=20
> Here is the algorithm of the mutual exclusion that is used in the thread=
=20
> pool:
>
> static intptr_t __stdcall Run(tef::sys::THREAD_TASK* task)
> {=20
>
>   ExclusiveTask* $this =3D static_cast<ExclusiveTask*>(task);=20
>
>   auto qutex =3D $this->qutex;=20
>
>   if( qutex->Lock() =3D=3D 1 ) {=20
>
>       $this->Callback(); // call back the lambda
>
>       while( qutex->Unlock() > 0 ) {=20
>
>          task =3D qutex->UnsafePop();=20
>
>          while( task =3D=3D nullptr ) {=20
>
>             task =3D qutex->UnsafePop();=20
>
>          }=20
>          // call back the lambda
>          ExclusiveTask* t =3D static_cast<ExclusiveTask*>(task);=20
>          t->Callback();
>          delete t;
>
>       }=20
>
>       delete $this;=20
>
>   } else {=20
>
>       qutex->Push($this);=20
>
>   }=20
>
>   return 0;=20
>
> }
>
>
> It is very simple, now, but it wasn't year ago. And it is multiple=20
> producer/single consumer queue (non-blocking, based on the atomic increme=
nt=20
> and compare exchange).
>
> I realize that in the standard library thread pool creation would be=20
> explicit. Something like:
>
> auto h =3D std:setThreadPoolSize(32);
>
> and/or a thread pool handler could be passed as a parameter to forks and=
=20
> joins also.
>
> However, I don't think the "qutex" concept gets us anywhere close to wher=
e=20
>> we ought to be in the end.
>
>
> What is the end?=20
>
> I do not see any parallel computational model so far.
> Intel TBB Flow Graph or Intel Cnc are awkward. Imagine you have to declar=
e=20
> a call order of all functions of your program in advance and their call=
=20
> conditions.
> So, what is alternative? I have even more advance computational model, bu=
t=20
> it is a way out of the conventional thinking (Method for Automatic=20
> Parallel Computing <http://www.freepatentsonline.com/y2015/0033242.html>)=
..
>
> By the way, you used 'qutex', not 'qumex'. I am not english native=20
> speaker, so 'qumex' does not sound right?
>
> Thanks
> Andrew
>
> On Saturday, April 4, 2015 at 3:39:15 PM UTC-4, Arthur O'Dwyer wrote:
>>
>> Now that I've read more of the documentation and have a better idea of=
=20
>> the concepts involved... If I understand correctly, you start from the=
=20
>> atomic concept of
>>
>>     (work-queue + consumer-pool-of-size-N)
>>
>> In your particular system there is a singleton global (work-queue +=20
>> consumer-pool-of-size-LARGE) that you call "the thread pool", to which j=
obs=20
>> can be submitted via gpc::fork();  and your system also supports=20
>> constructible-on-the-fly (work-queue + consumer-pool-of-size-1)s, which =
you=20
>> call "qutexes" and to which jobs can be submitted via qutex::join().
>>
>> If anything like this model were proposed for standardization, I'd hope=
=20
>> that it would standardize the underlying (work-queue +=20
>> consumer-pool-of-size-N) model, so that you could have=20
>> constructible-on-the-fly work-queues with consumer-pools of size 2 (for=
=20
>> example).  Perhaps the atomic concept should even *be* split up, so that=
 a=20
>> single consumer-pool could pull from two different work-queues, etc. etc=
..
>>
>> Notice that a work-queue with only a single producer and/or only a singl=
e=20
>> consumer can be implemented with greater efficiency than a work-queue wi=
th=20
>> multiple producers and/or consumers, so there's an efficiency win there=
=20
>> that should be reflected in the library somehow. However, I don't think =
the=20
>> "qutex" concept gets us anywhere close to where we ought to be in the en=
d.
>>
>> =E2=80=93Arthur
>>
>> On Saturday, April 4, 2015 at 7:46:59 AM UTC-7, t...@tentity.com wrote:
>>>
>>> Thanks.=20
>>> Now I am thinking "qumex" which abbreviation for *Qu*eue of *M*utual=20
>>> *Ex*clusion.=20
>>> Would it be better?
>>>
>>> On Friday, April 3, 2015 at 6:48:48 PM UTC-4, Arthur O'Dwyer wrote:
>>>>
>>>> On Friday, April 3, 2015 at 5:15:13 AM UTC-7, t...@tentity.com wrote:
>>>>>
>>>>>  Quetex is Mutual Exclusion Queue. It eliminates blocking/waiting and=
=20
>>>>> thread switching in comparison to mutexes and futures.
>>>>>
>>>>>  gpc::quetex<int> qtx;
>>>>>
>>>>>
>>>> Not related to the semantics, but FYI, "quetex" looks like it ought to=
=20
>>>> be pronounced "kaytex", and you lose the pun. Consider "queuetex" or=
=20
>>>> "qutex" instead. :)
>>>>
>>>> =E2=80=93Arthur
>>>>
>>>

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_1196_1826248938.1428678207536
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Single consumer queue is not good for modern hardware, at =
least we need to have one thread i.e. one consumer per core.<br><br>For the=
 parallel computational model, I was working on .Net before, and was using =
lambda expressions to define the order of steps,<div>imaging,</div><div><br=
></div><div>auto x =3D define_a_procedure(</div><div>[]() {</div><div>... d=
o some processor work ...</div><div>waitfor(an_io_or_lock); // the lock her=
e is not the common lock</div><div>goto_next_step();<br>},</div><div>[]() {=
</div><div>... obtained the lock or io operation finished ...</div><div>...=
 do some processor work ...</div><div>goto_finish();<br>});</div><div>run(x=
); // non-blocking</div><div>And each step may work on different threads, t=
he whole procedure will not stop until goto_finish() involved.</div><div>Bu=
t when porting to c++, issues as the lifetime of the procedure, it should k=
eep alive until goto_finish(), and meanwhile, the most important thing is, =
if we need to refer some local variables &lt;which is the reason to use lam=
bda expressions&gt;, we also need to consider the lifetime of these variabl=
es. I tried to use shared_ptr everywhere, but still have some trouble.</div=
><div><br>On Sunday, April 5, 2015 at 7:39:15 AM UTC+8, t...@tentity.com wr=
ote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex=
;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>Let =
me make some clarification.</div><div>In my system, I have one thread pool =
for everything: forks, joins, http requests, timers, etc.</div><div>I avoid=
 creating threads (that is why I do not use std::async) and I avoid switchi=
ng threads.</div><div>I don't see any reason to have more than one thread p=
er core (20 years ago I would do because it was only one core CPU, but not =
now).&nbsp;<br></div><div>So, I do not create a thread pool per a qutex, bu=
t I use one thread pool for everything.&nbsp;<br></div><div>Here is the alg=
orithm of the mutual exclusion that is used in the thread pool:</div><div><=
br></div><div>







<div style=3D"border:1px solid rgb(187,187,187);word-wrap:break-word;backgr=
ound-color:rgb(250,250,250)"><code><div><span style=3D"color:#008">static</=
span><span style=3D"color:#000"> intptr_t __stdcall </span><span style=3D"c=
olor:#606">Run</span><span style=3D"color:#660">(</span><span style=3D"colo=
r:#000">tef</span><span style=3D"color:#660">::</span><span style=3D"color:=
#000">sys</span><span style=3D"color:#660">::</span><span style=3D"color:#0=
00">THREAD_TASK</span><span style=3D"color:#660">*</span><span style=3D"col=
or:#000"> task</span><span style=3D"color:#660">)</span><span style=3D"colo=
r:#000"><br></span><span style=3D"color:#660">{</span><span style=3D"color:=
#000"> <br><br>&nbsp; </span><span style=3D"color:#606">ExclusiveTask</span=
><span style=3D"color:#660">*</span><span style=3D"color:#000"> $this </spa=
n><span style=3D"color:#660">=3D</span><span style=3D"color:#000"> </span><=
span style=3D"color:#008">static_cast</span><span style=3D"color:#660">&lt;=
</span><span style=3D"color:#606">ExclusiveTask</span><span style=3D"color:=
#660">*&gt;(</span><span style=3D"color:#000">ta<wbr>sk</span><span style=
=3D"color:#660">);</span><span style=3D"color:#000"> <br><br>&nbsp; </span>=
<span style=3D"color:#008">auto</span><span style=3D"color:#000"> qutex </s=
pan><span style=3D"color:#660">=3D</span><span style=3D"color:#000"> $this<=
/span><span style=3D"color:#660">-&gt;</span><span style=3D"color:#000">qut=
ex</span><span style=3D"color:#660">;</span><span style=3D"color:#000"> <br=
><br>&nbsp; </span><span style=3D"color:#008">if</span><span style=3D"color=
:#660">(</span><span style=3D"color:#000"> qutex</span><span style=3D"color=
:#660">-&gt;</span><span style=3D"color:#606">Lock</span><span style=3D"col=
or:#660">()</span><span style=3D"color:#000"> </span><span style=3D"color:#=
660">=3D=3D</span><span style=3D"color:#000"> </span><span style=3D"color:#=
066">1</span><span style=3D"color:#000"> </span><span style=3D"color:#660">=
)</span><span style=3D"color:#000"> </span><span style=3D"color:#660">{</sp=
an><span style=3D"color:#000"> <br><br>&nbsp; &nbsp; &nbsp; $this</span><sp=
an style=3D"color:#660">-&gt;</span><span style=3D"color:#606">Callback</sp=
an><span style=3D"color:#660">();</span><span style=3D"color:#000"> </span>=
<span style=3D"color:#800">// call back the lambda</span><span style=3D"col=
or:#000"><br><br>&nbsp; &nbsp; &nbsp; </span><span style=3D"color:#008">whi=
le</span><span style=3D"color:#660">(</span><span style=3D"color:#000"> qut=
ex</span><span style=3D"color:#660">-&gt;</span><span style=3D"color:#606">=
Unlock</span><span style=3D"color:#660">()</span><span style=3D"color:#000"=
> </span><span style=3D"color:#660">&gt;</span><span style=3D"color:#000"> =
</span><span style=3D"color:#066">0</span><span style=3D"color:#000"> </spa=
n><span style=3D"color:#660">)</span><span style=3D"color:#000"> </span><sp=
an style=3D"color:#660">{</span><span style=3D"color:#000"> <br><br>&nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;task </span><span style=3D"color:#660">=3D</span=
><span style=3D"color:#000"> qutex</span><span style=3D"color:#660">-&gt;</=
span><span style=3D"color:#606">UnsafePop</span><span style=3D"color:#660">=
();</span><span style=3D"color:#000"> <br><br>&nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp;</span><span style=3D"color:#008">while</span><span style=3D"color:#66=
0">(</span><span style=3D"color:#000"> task </span><span style=3D"color:#66=
0">=3D=3D</span><span style=3D"color:#000"> </span><span style=3D"color:#00=
8">nullptr</span><span style=3D"color:#000"> </span><span style=3D"color:#6=
60">)</span><span style=3D"color:#000"> </span><span style=3D"color:#660">{=
</span><span style=3D"color:#000"> <br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; task </span><span style=3D"color:#660">=3D</span><span style=3D"c=
olor:#000"> qutex</span><span style=3D"color:#660">-&gt;</span><span style=
=3D"color:#606">UnsafePop</span><span style=3D"color:#660">();</span><span =
style=3D"color:#000"> <br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><spa=
n style=3D"color:#660">}</span><span style=3D"color:#000"> <br></span><span=
 style=3D"color:rgb(136,0,0)"><span style=3D"color:#000">&nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp;</span><span style=3D"color:#800">// call back the lambda</=
span></span><span style=3D"color:#000"><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p;</span><span style=3D"color:#606">ExclusiveTask</span><span style=3D"colo=
r:#660">*</span><span style=3D"color:#000"> t </span><span style=3D"color:#=
660">=3D</span><span style=3D"color:#000"> </span><span style=3D"color:#008=
">static_cast</span><span style=3D"color:#660">&lt;</span><span style=3D"co=
lor:#606">ExclusiveTask</span><span style=3D"color:#660">*&gt;(</span><span=
 style=3D"color:#000">ta<wbr>sk</span><span style=3D"color:#660">);</span><=
span style=3D"color:#000"> <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t</span><s=
pan style=3D"color:#660">-&gt;</span><span style=3D"color:rgb(102,0,102)"><=
span style=3D"color:#606">Callback</span></span><span style=3D"color:#660">=
();</span><span style=3D"color:#000"><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
</span><span style=3D"color:#008">delete</span><span style=3D"color:#000"> =
t</span><span style=3D"color:#660">;</span><span style=3D"color:#000"><br><=
br>&nbsp; &nbsp; &nbsp; </span><span style=3D"color:#660">}</span><span sty=
le=3D"color:#000"> <br><br>&nbsp; &nbsp; &nbsp; </span><span style=3D"color=
:#008">delete</span><span style=3D"color:#000"> $this</span><span style=3D"=
color:#660">;</span><span style=3D"color:#000"> <br><br>&nbsp; </span><span=
 style=3D"color:#660">}</span><span style=3D"color:#000"> </span><span styl=
e=3D"color:#008">else</span><span style=3D"color:#000"> </span><span style=
=3D"color:#660">{</span><span style=3D"color:#000"> <br><br>&nbsp; &nbsp; &=
nbsp; qutex</span><span style=3D"color:#660">-&gt;</span><span style=3D"col=
or:#606">Push</span><span style=3D"color:#660">(</span><span style=3D"color=
:#000">$this</span><span style=3D"color:#660">);</span><span style=3D"color=
:#000"> <br><br>&nbsp; </span><span style=3D"color:#660">}</span><span styl=
e=3D"color:#000"> <br><br>&nbsp; </span><span style=3D"color:#008">return</=
span><span style=3D"color:#000"> </span><span style=3D"color:#066">0</span>=
<span style=3D"color:#660">;</span><span style=3D"color:#000"> <br><br></sp=
an><span style=3D"color:#660">}</span></div></code></div><p><span><br></spa=
n></p></div><div>It is very simple, now, but it wasn't year ago. And it is =
multiple producer/single consumer queue (non-blocking, based on the atomic =
increment and compare exchange).</div><div><br></div><div>I realize that in=
 the standard library thread pool creation would be explicit. Something lik=
e:</div><div><br></div><div><div style=3D"border:1px solid rgb(187,187,187)=
;word-wrap:break-word;background-color:rgb(250,250,250)"><code><div><span s=
tyle=3D"color:#008">auto</span><span style=3D"color:#000"> h </span><span s=
tyle=3D"color:#660">=3D</span><span style=3D"color:#000"> std</span><span s=
tyle=3D"color:#660">:</span><span style=3D"color:#000">setThreadPoolSize</s=
pan><span style=3D"color:#660">(</span><span style=3D"color:#066">32</span>=
<span style=3D"color:#660">);</span></div></code></div><br></div><div>and/o=
r a thread pool handler could be passed as a parameter to forks and joins a=
lso.</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:=
0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);=
border-left-style:solid;padding-left:1ex">However, I don't think the "qutex=
" concept gets us anywhere close to where we ought to be in the end.</block=
quote><div><br></div><div>What is the end?&nbsp;</div><div><br></div><div>I=
 do not see any parallel computational model so far.</div><div>Intel TBB Fl=
ow Graph or Intel Cnc are awkward. Imagine you have to declare a call order=
 of all functions of your program in advance and their call conditions.</di=
v><div>So, what is alternative? I have even more advance computational mode=
l, but it is a way out of the conventional thinking (<a href=3D"http://www.=
freepatentsonline.com/y2015/0033242.html" target=3D"_blank" rel=3D"nofollow=
" onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fww=
w.freepatentsonline.com%2Fy2015%2F0033242.html\46sa\75D\46sntz\0751\46usg\7=
5AFQjCNEQIQ4OpC7iDRbw1Xt0MyW4EI2v9Q';return true;" onclick=3D"this.href=3D'=
http://www.google.com/url?q\75http%3A%2F%2Fwww.freepatentsonline.com%2Fy201=
5%2F0033242.html\46sa\75D\46sntz\0751\46usg\75AFQjCNEQIQ4OpC7iDRbw1Xt0MyW4E=
I2v9Q';return true;">Method for Automatic Parallel Computing</a>).</div><di=
v><br></div><div>By the way, you used 'qutex', not 'qumex'. I am not englis=
h native speaker, so 'qumex' does not sound right?</div><div><br></div><div=
>Thanks</div><div>Andrew</div><br>On Saturday, April 4, 2015 at 3:39:15 PM =
UTC-4, Arthur O'Dwyer wrote:<blockquote class=3D"gmail_quote" style=3D"marg=
in:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div di=
r=3D"ltr">Now that I've read more of the documentation and have a better id=
ea of the concepts involved... If I understand correctly, you start from th=
e atomic concept of<div><br></div><div>&nbsp; &nbsp; (work-queue + consumer=
-pool-of-size-N)</div><div><br></div><div>In your particular system there i=
s a singleton global (work-queue + consumer-pool-of-size-LARGE) that you ca=
ll "the thread pool", to which jobs can be submitted via gpc::fork(); &nbsp=
;and your system also supports constructible-on-the-fly (work-queue + consu=
mer-pool-of-size-1)s, which you call "qutexes" and to which jobs can be sub=
mitted via qutex::join().</div><div><div><br></div><div>If anything like th=
is model were proposed for standardization, I'd hope that it would standard=
ize the underlying (work-queue + consumer-pool-of-size-N) model, so that yo=
u could have constructible-on-the-fly work-queues with consumer-pools of si=
ze 2 (for example). &nbsp;Perhaps the atomic concept should even *be* split=
 up, so that a single consumer-pool could pull from two different work-queu=
es, etc. etc.</div><div><br></div><div>Notice that a work-queue with only a=
 single producer and/or only a single consumer can be implemented with grea=
ter efficiency than a work-queue with multiple producers and/or consumers, =
so there's an efficiency win there that should be reflected in the library =
somehow. However, I don't think the "qutex" concept gets us anywhere close =
to where we ought to be in the end.</div><div><br></div><div>=E2=80=93Arthu=
r</div><br>On Saturday, April 4, 2015 at 7:46:59 AM UTC-7, <a>t...@tentity.=
com</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-le=
ft:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Than=
ks.&nbsp;<div>Now I am thinking "qumex" which abbreviation for <b>Qu</b>eue=
 of <b>M</b>utual <b>Ex</b>clusion.&nbsp;</div><div>Would it be better?<br>=
<br>On Friday, April 3, 2015 at 6:48:48 PM UTC-4, Arthur O'Dwyer wrote:<blo=
ckquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-le=
ft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Friday, April 3, 20=
15 at 5:15:13 AM UTC-7, <a>t...@tentity.com</a> wrote:<blockquote class=3D"=
gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid=
;padding-left:1ex"><div dir=3D"ltr"><p></p><p><span>







</span></p><p><span>







</span></p><p><span>Quetex is Mutual Exclusion Queue. I</span>t eliminates =
blocking/waiting and thread switching in comparison to mutexes and futures.=
</p><div style=3D"border:1px solid rgb(187,187,187);word-wrap:break-word;ba=
ckground-color:rgb(250,250,250)"><code><div><span style=3D"color:#000"><br>=
&nbsp;gpc</span><span style=3D"color:#660">::</span><span style=3D"color:#0=
00">quetex</span><span style=3D"color:#080">&lt;int&gt;</span><span style=
=3D"color:#000"> qtx</span><span style=3D"color:#660">;</span><span style=
=3D"color:#000"><br><br></span></div></code></div></div></blockquote><div><=
br></div><div>Not related to the semantics, but FYI, "quetex" looks like it=
 ought to be pronounced "kaytex", and you lose the pun. Consider "queuetex"=
 or "qutex" instead. :)</div><div><br></div><div>=E2=80=93Arthur</div></div=
></blockquote></div></div></blockquote></div></div></blockquote></div></blo=
ckquote></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_1196_1826248938.1428678207536--
------=_Part_1195_964796084.1428678207536--

.
