One major recurring problem with all these Async talks at #CppCon is that they assume the program starts with main(), or you will eventually wait. For simple “script-like” applications that’s fine. For anything larger, it’s insufficient.
-
Näytä tämä ketju
-
If we want a paradigm of parallelism we have to stop thinking that your program’s entry point is main. A parallel applications’s entry point is the first task. That task spawns more tasks. When there are no active tasks, the program is ready to exit.
1 vastaus 0 uudelleentwiittausta 5 tykkäystäNäytä tämä ketju -
Main() should initialize your tasks queue and launch Task0. You real application starts there. Wait of any kind should be forbidden. If you truly can’t continue execution until some condition is met, you reschedule the current task.
1 vastaus 0 uudelleentwiittausta 4 tykkäystäNäytä tämä ketju -
Your application “loop” is done by the tail task scheduling the head task again. This sort of looping is rarely addressed. Yeah we get parallel loops. Those aren’t the challenging part. Those are “embarrassingly” easy.
1 vastaus 0 uudelleentwiittausta 5 tykkäystäNäytä tämä ketju -
We need to talk about the entire application being a parallel/concurrent application, starting from your entry point.
3 vastausta 0 uudelleentwiittausta 5 tykkäystäNäytä tämä ketju -
Vastauksena käyttäjälle @tloch14
Yes, using lock, wait and get are bugs in an async app. Except when maintaining an invariant for some existing code dependency. Such as preventing main from exiting until the async graph completes. I would love to have an async entry point for c++ programs. It needs a paper.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä
I already started a library that shores up a basic scheduler and requires a taskMain() implementation. I’ll hopefully post it to GitHub for others to experiment.
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.