Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
cython-plus
typon
Commits
68aaebf5
Commit
68aaebf5
authored
Jul 11, 2022
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments to scheduler.hpp and stack.hpp
parent
6d64f7d0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
rt/include/typon/scheduler.hpp
rt/include/typon/scheduler.hpp
+18
-0
rt/include/typon/stack.hpp
rt/include/typon/stack.hpp
+37
-0
No files found.
rt/include/typon/scheduler.hpp
View file @
68aaebf5
#ifndef TYPON_SCHEDULER_HPP_INCLUDED
#define TYPON_SCHEDULER_HPP_INCLUDED
/* Continuation-stealing scheduler */
/* Papers:
. N. S. Arora, R. D. Blumofe, and C. G. Plaxton. 1998.
Thread scheduling for multiprogrammed multiprocessors.
https://doi.org/10.1145/277651.277678
. C. X. Lin, T .W Huang, and M. D. F. Wong. 2020.
An efficient work-stealing scheduler for task dependency graph.
https://tsung-wei-huang.github.io/papers/icpads20.pdf
. F. Schmaus, N. Pfeiffer, W. Schröder-Preikschat, T. Hönig, and J. Nolte.
2021. Nowa: a wait-free continuation-stealing concurrency platform.
https://www4.cs.fau.de/Publications/2021/schmaus2021nowa.pdf
*/
#include <atomic>
#include <bit>
#include <coroutine>
...
...
rt/include/typon/stack.hpp
View file @
68aaebf5
#ifndef TYPON_FUNDAMENTAL_STACK_HPP_INCLUDED
#define TYPON_FUNDAMENTAL_STACK_HPP_INCLUDED
/* Work-stealing deque */
/* A stack of continuations that may be stolen and resumed concurrently.
Continuations are pushed when a potentially concurrent child task is
started and popped when the child completes, unless stolen first by a
concurrent worker. Thieves steal from the oldest continuations first,
while completed children tasks try to resume the most recent.
Furthermore, the whole stack may be suspended while waiting for an
asynchronous operation. In that case thieves may still steal but the
most recent child task is suspended. Suspended stacks will be enabled
when the asynchronous operation completes, at which point a thief may
take over the whole stack and resume the suspended child task.
There are five possible states:
- ACTIVE: A worker is actively running a child task.
- WAITING: Waiting on an asynchronous operation.
- EMPTY: Like WAITING, but no continuation remains unstolen.
- READY: A thief may take the whole stack and resume the suspended task.
- DONE: No more task remains, suspended or otherwise.
Papers:
. D. Chase and Y. Lev. 2005.
Dynamic circular work-stealing deque.
https://doi.org/10.1145/1073970.1073974
. N. M. Lê, A. Pop, A. Cohen, and F. Zappa Nardelli. 2013.
Correct and efficient work-stealing for weak memory models.
https://doi.org/10.1145/2517327.2442524
. Kyle Singer, Yifan Xu, and I-Ting Angelina Lee. 2019.
Proactive work stealing for futures.
https://doi.org/10.1145/3293883.3295735
*/
#include <atomic>
#include <cstdint>
#include <memory>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment