Open iwelch opened 6 years ago
cc @amitmurthy @tanmaykm
if you decide to implement this, maybe lay the groundwork for another feature, too: two more signals like "TASKraiseimportance" and "TASKlowerimportance." they could help the scheduler assign the current task to a lower or higher end CPU in a heterogeneous environment, for example. this is of secondary importance and probably not worth the effort, at least not soon.
/iaw
I think pmap
is the wrong interface to provide this, but I would encourage development of functionality like this in a package first to experiment with the implementation
code that is called by
pmap()
should have the ability to signal to the scheduler a (dynamic) determination not to schedule any more new tasks. existing tasks should either be finished or aborted, depending on signal.For example, after any one task function has signaled “TASKSNONEW”, the scheduler should stop 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 function signals “TASKSALLABORT”, the scheduler should further 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 to become dynamic. I also hope that it can be implemented 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---a more obscure task.In addition, I think the
pmap()
call should have arguments to set timeouts, both for itself and for individual tasks.