This PR adds a new class to manage threads - #11
Open
juanjqo wants to merge 8 commits into
Open
Conversation
mmmarinho
requested changes
Aug 30, 2026
mmmarinho
left a comment
Member
There was a problem hiding this comment.
Thanks for the submission. Some suggestions!
| namespace sas | ||
| { | ||
|
|
||
| class thread_manager |
Member
There was a problem hiding this comment.
Class names are PascalCase I think?
|
|
||
|
|
||
| // Performance monitoring using sas::Clock | ||
| double get_computation_time() const; |
Member
There was a problem hiding this comment.
I recommend adding a get_clock() method that returns a const& so that you don't have to copy all the methods and make this a bit easier to maintain.
| void thread_manager::stop() | ||
| { | ||
| if (!running_.exchange(false)) { | ||
| return; // Not running |
Member
There was a problem hiding this comment.
Maybe you don't need to return early but I'm happy to be corrected. Isn't it ok to always check if it's joinable?
| * @details The method maps the abstract PRIORITY levels to specific Linux | ||
| * scheduler policies and priority values: | ||
| * | ||
| * | PRIORITY Level | Linux Policy | Priority Value | Description | |
Member
There was a problem hiding this comment.
Is there any specific source for this or an original thought? Either way it's fine, just curiosity.
| * control.start(); | ||
| * @endcode | ||
| */ | ||
| void thread_manager::apply_cpu_affinity() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @mmmarinho,
This PR adds the class
sas::thread_manager(codename: loopancho) to manage threads. The main motivation is the standardisation of the SAS drivers (at least in the Adorno-lab::RAICo projects), which currently implement custom threads. This class is experimental, since I haven't tested it yet with real platforms. It is the first version and we can improve it.Current features:
sas::Clockfor time computations.Please let me know what you think and whether the design aligns with what you have in mind.
Minimal example
CMake
output
Kind regards,
Juancho