www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Process Queue and Pool

reply =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
I'm looking for a variant of taskPool but for pids created by 
spawnProcess. The typical patterns it to create a set of 
potentially created processes in ProcessQueue together with a 
ProcessPool that automatically pops for the ProcessQueue when 
their the number of activate processes in ProcessPool has below a 
certain counter which is a member of ProcessPool. Maybe the Queue 
and the Pool should be one aggregate. The typically usage is in a 
build system that only keeps a limited number of processes 
activate at the same time.

Has anybody written such a thing?
Aug 26 2014
parent =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
On Tuesday, 26 August 2014 at 09:57:57 UTC, Nordlöw wrote:
 Has anybody written such a thing?
I guess the logic of this ProcessPool should run in its own thread by default and be protected in the same way that taskPool. Of course one solution is to reuse taskPool and spawn one thread or fiber (when it becomes available in std.concurrency) for each currently active Process, right?
Aug 26 2014