Then there's the "design argument": I want juniors to understand that data processing and business operation execution are not "algorithmic recipes" (Do this, wait for that, process that, etc) but a continuous flow of work, and as part of your work you could trigger more work
-
-
Vastauksena käyttäjille @Manu343726, @dougbinks ja
(Process input, process it in parallel, when done sum it, then serialize the result, etc)
1 vastaus 0 uudelleentwiittausta 1 tykkäys -
So waiting doesn't block the flow of work, as the wait processes other tasks. There is the potential for deadlock if used incorrectly rather than spawning a dependent task though.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
True
1 vastaus 0 uudelleentwiittausta 1 tykkäys -
In theory true. In practice not. Again, tweets will fail here, but when I get a chance to make another diagram I will.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
In practice this has been working well for myself and others, though I'm sure it can be improved.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Here is the example. Basically waiting on one core can starve other cores. Avoiding waits will keep your cores all saturated with work. You can see a real-world example of this here: http://twvideo01.ubm-us.net/o1/vault/gdc2015/presentations/Gyrling_Christian_Parallelizing_The_Naughty.pdf … (1/3rd down)pic.twitter.com/HUytO6gB4L
3 vastausta 0 uudelleentwiittausta 2 tykkäystä -
So my intuition "continuations better than waits" is empirically correct. Great
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
I think the word empirical is wrong here as you need to compare real alternatives with similar effort. A task manager with continuations might have higher overhead such that tasks need to be less fine grained, and fine grained tasks help reduce bubbles and increase scalability.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjille @dougbinks, @Manu343726 ja
I do think explicit dependencies are worthwhile, and they are on the plan for enkiTS once I get some solid time to implement and test.
2 vastausta 0 uudelleentwiittausta 0 tykkäystä
FWIW, I checked out EnkiTS and I don't think you need to modify it to accommodate dependencies or continuations. A user can easily create a TaskSetWithContinuation class derived from ITaskSet or build a dependency hierarchy that just calls your scheduler.
-
-
Vastauksena käyttäjille @tloch14, @dougbinks ja
@Manu343726, if you're evaluating it, I would definitely give this a go and write your own derived class to support continuations/onComplete tasks.1 vastaus 0 uudelleentwiittausta 1 tykkäys -
Adding single task continuations should be trivial, but also not that useful since you could also just launch the tasks at the end of your task function, and this doesn't solve the issues mentioned above. Multiple dependencies such as the proposed C++ when_all are trickier.
2 vastausta 0 uudelleentwiittausta 1 tykkäys - Näytä vastaukset
Uusi keskustelu -
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.