I wouldn't say waiting is an anti-pattern, but then I chose that approach for enkiTS so I guess that's already obvious. The wait approach is effective, and it simplifies the task manager (enkiTS is designed to be lightweight).
-
-
Yeah, the issue here is that we work in different worlds (You're realtime "I-know-my-task-set", I'm event driven long-live app "I-know-nothing-about-the-potential-task-set-of-the-app")
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjille @Manu343726, @dougbinks ja
so waiting is almost always an antipattern because I don't know the work peak of the system (I have no control). So blocking a task should be avoided as much as possible. Keep it flowing, don't wait but spawn async continuations to be processed later when the data arrives
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjille @Manu343726, @dougbinks ja
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
1 vastaus 0 uudelleentwiittausta 1 tykkäys -
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ä
I worked on a project where we ran tet-mesh soft body and fracturing simulation. Waits like this destroyed our performance, and it wasn't something we could fix -- the sim library was 3rd party.
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.