The current model in enkiTS is that tasks can call other tasks and waiting for tasks will run any available tasks. This means the stack can grow with each dependency, so I'm considering adding explicit dependencies.
-
-
In my experience with tasks, having Wait assist on the queue is a great way to cause deadlocks. I basically abolished Wait from my task library and put an explicit “AssistOnQueue()” function. Usage of it is considered code smell, but valid rarely.
2 vastausta 0 uudelleentwiittausta 0 tykkäystä -
The only way the wait in enkiTS should cause a deadlock is if you have two tasks waiting on each other. This is a programming error which would easily be found since the program would always deadlock.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Not quite. If you have 4 threads, it's likely that another thread calls wait() and picks up the dependent task, safely making sure that the originally waiting task doesn't deadlock. This is also why I always test on 1 thread in addition to coreCount threads.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
That can't happen in enkiTS, or we're misunderstanding each other (easy on twitter). I also test on 1 to hardware thread count threads.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
You're right about twitter. Hope this helps. In the two scenarios, depending on which core picks up Task D, a deadlock *may* occur. Certainly, one a single core it's almost guaranteed. This is why wait-with-assist is multithreading code smell.pic.twitter.com/NijYw9eL1j
1 vastaus 1 uudelleentwiittaus 6 tykkäystä -
Vastauksena käyttäjille @tloch14, @dougbinks ja
The solution here is to replace Waits with continuations. It's not always an easy change to make, but it's worth it. Especially timing (gpu/network/disc async calls?) start mixing things up even more.
2 vastausta 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjille @tloch14, @dougbinks ja
Or use fibers.
2 vastausta 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjille @mikulasflorek, @dougbinks ja
http://twvideo01.ubm-us.net/o1/vault/gdc2015/presentations/Gyrling_Christian_Parallelizing_The_Naughty.pdf … Naughty Dog used fibers and still had wait problems. Fibers doesn't solve all wait problems.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjille @tloch14, @dougbinks ja
They solve the deadlock issue.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä
Ah yeah that's true.
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.