[Issue 8214] blocking option for TaskPool.finish()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 9 19:59:48 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8214


John Belmonte <john at neggie.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsimcha at yahoo.com


--- Comment #1 from John Belmonte <john at neggie.net> 2012-06-09 20:01:48 PDT ---
Looking at source I see the original version includes TaskPool.join() which has
the desired behavior.  However the method definition is disabled:

 
https://github.com/D-Programming-Language/phobos/blob/master/std/parallelism.d#L3097

In 2011 dsimcha mentioned the join function [1]:

    "One thing Andrei mentioned that I'm really not sure about is what to do 
with TaskPool.join().  My example for it is still terrible, because I 
think it's an evolutionary artifact.  It was useful in earlier designs 
that were never released and didn't have high-level data parallelism 
primitives.  I never use it, don't have any good use cases for it and 
would be inclined to remove it entirely.  Andrei seems to have some good 
use cases in mind, but he has not detailed any that I believe are 
reasonably implementable and I'm not sure whether they could be solved 
better using the higher-level data parallelism primitives."

and

    "I put TaskPool.join() in a version(none) statement and removed all 
references to it from the documentation.  If anyone has a compelling 
reason why this is useful (preferably with a good, short example), I'll 
add it back.  Otherwise, it's gone, since IMHO it's an evolutionary 
artifact that makes sense in theory but that I can't think of a use for 
anymore in practice."

Well, I have a use case :)  I'm writing a D implementation of luaproc, the Lua
share-nothing message passing framework described in "Exploring Lua for
Concurrent Programming" [2].  The std.parallelism module nicely replaces
several hundred lines of low level multithreading code in the original C
implementation.    The design requires a single queue of tasks serviced by
multiple threads, where the tasks do not yield a return value (they only
optionally schedule more tasks), and any errors within a task are discarded
(i.e. exceptions don't need to be propagated to parent tasks).  The design
specifies a function which blocks on the completion of all tasks, and this is
the only thing std.parallelism is missing.


[1] http://forum.dlang.org/thread/imehn5$h78$1@digitalmars.com
[2] http://www.inf.puc-rio.br/~roberto/docs/ry08-05.pdf

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list