Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow taskwait from within tasks #122

Merged
merged 12 commits into from
Nov 25, 2023
Merged

Allow taskwait from within tasks #122

merged 12 commits into from
Nov 25, 2023

Conversation

computablee
Copy link
Owner

Which issue are you addressing?

Closes #49

How have you addressed the issue?

There's been a lot of changes. To use taskwait from within a task, you must specify which tasks to wait on. Taskwait keeps track of whether or not it's being called from parallel space or from task space, and will selectively enact barriers depending on the behavior. If a task is being called from global space, it's treated as a barrier, but if called from within a task, it won't act as a barrier.

If you don't specify the tasks to wait on when calling taskwait from within a task, an exception is thrown. Specifying the tasks to wait on does not affect how tasks are scheduled-- the calling thread begins executing tasks as normal, but returns from taskwait when it detects that the selected tasks have completed instead of waiting when the task queue is empty.

How have you tested your patch?

Two new tests have been added, which checks to make sure that you can wait on tasks from within a task via taskwait, and another test to make sure that improper taskwait usage throws an exception.

Copy link

codecov bot commented Nov 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1eb0423) 99.22% compared to head (4203bdd) 99.25%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #122      +/-   ##
==========================================
+ Coverage   99.22%   99.25%   +0.02%     
==========================================
  Files          12       12              
  Lines        1291     1341      +50     
  Branches      137      146       +9     
==========================================
+ Hits         1281     1331      +50     
  Misses          5        5              
  Partials        5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@computablee computablee merged commit 4c02a0b into main Nov 25, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] No way to wait on child tasks from within a task without deadlock
1 participant