# Pmap feature for dynamic decisions

**URL:** https://discourse.julialang.org/t/pmap-feature-for-dynamic-decisions/10050
**Category:** Internals & Design
**Created:** [March 29, 2018, 2:01pm UTC](https://discourse.julialang.org/t/pmap-feature-for-dynamic-decisions/10050 "2018-03-29T14:01:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)
#### Post date: [March 29, 2018, 2:01pm UTC](https://discourse.julialang.org/t/pmap-feature-for-dynamic-decisions/10050/1 "2018-03-29T14:01:02Z")

</div>

can I ask for feedback on a feature request?

code that is called by `pmap` should have the ability to signal to the scheduler a (dynamic) determination not to schedule any more tasks. existing tasks should either be finished or aborted

For example, when any one task fun signals “DONE NICE”, the scheduler stops scheduling further processes, but let’s the remaining tasks finish (e.g., we already found the alien, when the search parties come back, don’t send them out again); when any one task fun signals “DONE ABORT”, the scheduler also immediately terminates all other tasks ( (e.g., the alien has found us, is hostile, and we will need all search parties to come back immediately to help defend the base).

I think this is in the spirit of `pmap`, but greatly improves its previously static functionality dynamic, with relatively little pain to the developers (catch interrupt?) and to the user. it becomes much easier for the user to signal “done” than having to write their own schedulers.

shall I file a feature request issue or not?

---

<div class="post-metadata">

### Author: ![pasha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pasha/32/3319_2.png) [@pasha](https://discourse.julialang.org/u/pasha)
#### Post date: [March 29, 2018, 5:16pm UTC](https://discourse.julialang.org/t/pmap-feature-for-dynamic-decisions/10050/2 "2018-03-29T17:16:14Z")

</div>

Nice idea. I’m undecided if this should be part of a simpler pmap, or whether a larger more generic scheduler could be built with this and other dynamic features. It would be nice to create enough infrastructure so mid-tier users do not have to write their own schedulers, as doing so involves a trip down the rabbit hole.

---

<div class="post-metadata">

### Author: ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)
#### Post date: [March 30, 2018, 12:34am UTC](https://discourse.julialang.org/t/pmap-feature-for-dynamic-decisions/10050/3 "2018-03-30T00:34:19Z")

</div>

thx. I filed it. let’s see. maybe they will like it… regards, /iaw
