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

Add shared_task<T> and shared_lazy_task<T> classes #2

Closed
lewissbaker opened this issue Apr 13, 2017 · 2 comments
Closed

Add shared_task<T> and shared_lazy_task<T> classes #2

lewissbaker opened this issue Apr 13, 2017 · 2 comments
Assignees

Comments

@lewissbaker
Copy link
Owner

The ability to have multiple consumers wait on the result of a task is required for some scenarios.
eg. where you want to pass a prerequisite task into multiple sub-tasks that each need to await that task.

The task<T> and lazy_task<T> classes are move-only and support only a single awaiting coroutine at a time.

This issue is proposing to add a shared_task<T> class and a shared_lazy_task<T> class that support copy-construction and assignment with reference-counting semantics and support multiple concurrent awaiting coroutines.

It should be possible to implement in a lock-free fashion using std::atomic pointers.

@lewissbaker lewissbaker self-assigned this Apr 24, 2017
@lewissbaker
Copy link
Owner Author

Commit 5710f40 adds support for shared_task<T> with lock-free implementation.

@lewissbaker
Copy link
Owner Author

Commit 7a2ce58 adds support for shared_lazy_task.

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

No branches or pull requests

1 participant