Closed sbak5 closed 5 years ago
@sbak5 thanks for taking a look at this -- I'm sure this has been a tough one to think through.
Before opening pull requests, it's always a good idea to run all of the c and cpp tests we have to verify no regressions have been introduced. I just tried that, and it looks like there's now a failing assertion in cpp/finish0. There may be other failing tests, I only took a quick look. I believe the c/memory/allocate test is now hanging as well (see the Travis builds, which hit that error). We'll need those issues resolved before merging (as well as any other failing tests), as both of those tests pass on the master branch.
You should be able to simply use the test_all.sh scripts under the test/c/ and test/cpp/ directories to run all of the tests.
Thanks!
Max
Hello, Max, Yeah, my patch doesn't consider the example where future is used. I'll push a patch to resolve the case to resolve the issue.
Thanks, Seonmyeong Bak
I've pushed a fix to resolve the build errors.
The main issue was that the termination of runtime was not synchronized.
I added a task which is dependent on the root task so that the task signals other workers the root task is completed (now the counter value of the root finish is final). After this signal, we can use the counter value of the root finish as our termination condition.
@sbak5 looks good, all the tests are passing on my laptop as well.
one final step: could you add Sriraj's original deadlock example as a test in the appropriate directory (I can't remember if it was c or cpp)? That way, we prevent against future regressions.
Thanks for working on this!
I just added. The name of the test is nested_finish_async_await.cpp in test/cpp
@sbak5 looks like the build failed/hung? could you try rerunning the Travis tests?
How can I rerun the travis test? Do I need to recommit?
@agrippa The build of this commit is OK this time.
This fixes the issue #73 considering that root finish can run in core_work_loop so all the workers cannot get out of the loop by 'hclib_signal_join'