Without risking the case of the 2 tasks running on the same thread and having them both stopped.
I want the first task to wait until another task finishes some action. After the second task is done with its action, it should wake the first task up and continue working from where it stopped. The first task should be waked up as well if the first task didn't do the action after a certain time.
Now, the major problem I am having is that since both are tasks, not threads, most solutions I found looks like they stop the thread, not the task only. So, it could be the case that both tasks be running on the same thread, and thus when I make the first task wait, both wait and it timeouts anyway.
A study by physicist Henry Tye of Cornell University suggests that the universe may not expand forever. Instead, it could eventually stop expanding, begin contracting and end in a "Big Crunch" roughly 20 billion years from now.
Maybe not as we now know that time can flow backwards.
It is clear from this aricle that "Time Is On My Side" no matter which direction it is flowing.,
https://noai.duckduckgo.com/?i...m%2Fwatch%3Fv%3DsEj8lUx0gwY
Matt Dinniman
I’m happy to announce that our friends at Peacock have officially greenlit the Dungeon Crawler Carl television series! Me, Chris Yost and Seth MacFarlane and his team at Fuzzy Door are all really excited to get to work. In the coming weeks I'll have more details, and if you're going to SDCC be sure to catch me and Chris on our DCC panel, but in the meantime I wanted to thank you, the fans, for helping make this happen.
— with Peacock TV and Seth MacFarlane.
Question
kInG aLeXo
Without risking the case of the 2 tasks running on the same thread and having them both stopped.
I want the first task to wait until another task finishes some action. After the second task is done with its action, it should wake the first task up and continue working from where it stopped. The first task should be waked up as well if the first task didn't do the action after a certain time.
Now, the major problem I am having is that since both are tasks, not threads, most solutions I found looks like they stop the thread, not the task only. So, it could be the case that both tasks be running on the same thread, and thus when I make the first task wait, both wait and it timeouts anyway.
Is there a clean solution around this ?
Thanks;
Link to comment
https://www.neowin.net/forum/topic/1133908-c-how-to-make-a-task-wait-until-other-task-wakes-it-up-or-timeout/Share on other sites
4 answers to this question
Recommended Posts