-
Notifications
You must be signed in to change notification settings - Fork 77
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
Use pthread_setaffinity_np for setting affinity rather than sched_setaffinity #190
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #190 +/- ##
==========================================
+ Coverage 72.13% 72.97% +0.84%
==========================================
Files 8 8
Lines 384 396 +12
Branches 64 65 +1
==========================================
+ Hits 277 289 +12
+ Misses 69 68 -1
- Partials 38 39 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@firesurfer can you check this once? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks good to me with a minor notes:
https://en.cppreference.com/w/cpp/thread/thread/native_handle native_handle is only available for systems with a posix threading model. I am not sure if there might be some weird combination of systems (apart from windows) where it is not available and might lead to compilation errors
Most of the systems now supports. The following information, I got it using Copilot Systems that support a POSIX threading model (also known as POSIX threads or Pthreads) include most Unix-like operating systems. POSIX threads are a standard for thread creation and synchronization, defined by the POSIX.1c standard (IEEE Std 1003.1c-1995). Here are some systems that support POSIX threads: Unix-like Operating Systems
Other Operating Systems
As this is the case, I think this should be good to go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and should give more flexibility ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR aims to change the earlier approach with
pthread_setaffinity_np
as it is more generic and it can be scalable to all other controllers.The good thing is it doesn't affect the recently merged changes : ros-controls/ros2_control#1852
I've also added corresponding tests in different places