BTW you have no plans to add continuations to enkiTS right? (Been evaluating different task engines for months and yours is one of the options heading the list. I don't want to write it myself and having to maintain it in production)
-
-
Vastauksena käyttäjille @Manu343726 ja @matt77hias
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.
1 vastaus 0 uudelleentwiittausta 1 tykkäys -
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, @tloch14 ja
Or just coroutines...
1 vastaus 0 uudelleentwiittausta 0 tykkäystä
Coroutines certainly solve a lot, but aren't available till c++20. If you're writing a C API, they aren't really an option.
-
-
Vastauksena käyttäjille @tloch14, @matt77hias ja
I tried to wrap task continuations with coroutines once and everything exploded (coroutines rescheduled in different threads)
0 vastausta 0 uudelleentwiittausta 0 tykkäystäKiitos. Käytämme tätä aikajanasi parantamiseen. KumoaKumoa
-
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.