The following issue has been SUBMITTED. 
====================================================================== 
http://austingroupbugs.net/view.php?id=1293 
====================================================================== 
Reported By:                joelsherrill
Assigned To:                
====================================================================== 
Project:                    1003.1(2016)/Issue7+TC2
Issue ID:                   1293
Category:                   Base Definitions and Headers
Type:                       Enhancement Request
Severity:                   Editorial
Priority:                   normal
Status:                     New
Name:                       Joel Sherrill 
Organization:               RTEMS.org 
User Reference:              
Section:                    pthread.h and add sys/cpuset.h 
Page Number:                NA - addition request 
Line Number:                NA - addition request 
Interp Status:              --- 
Final Accepted Text:         
====================================================================== 
Date Submitted:             2019-09-27 19:53 UTC
Last Modified:              2019-09-27 19:53 UTC
====================================================================== 
Summary:                    Add methods associated with manipulating pthread
affinity on SMP systems
Description: 
At least FreeBSD, Linux, and RTEMS implement a very similar set of methods
to support manipulation of pthread affinity on SMP systems. This is a
proposal to consider the addition of a set of methods supporting this
capability. The end solution should include the capabilities in existing
implementations but needs to standardize the method signatures and types.

- sys/cpuset.h defines a data structure which is a bitmap representing the
affinity set and operations on that structure. It is similar in concept to
sigset_t but beyond filling and clearing operations, there methods that are
more like boolean operations.  Ref for Linux: 

- pthread.h includes methods to set the affinity as part of the
pthread_attr_t that is set at creation time and dynamically. The dynamic
methods on Linux are defined as:

       #include <pthread.h>

       int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize,
                                  const cpu_set_t *cpuset);
       int pthread_getaffinity_np(pthread_t thread, size_t cpusetsize,
                                  cpu_set_t *cpuset);

Those that set the attribute are defined as:

       #include <pthread.h>

       int pthread_attr_setaffinity_np(pthread_attr_t *attr,
                          size_t cpusetsize, const cpu_set_t *cpuset);
       int pthread_attr_getaffinity_np(const pthread_attr_t *attr,
                          size_t cpusetsize, cpu_set_t *cpuset);
Desired Action: 
Add support for manipulation of pthread affinity.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2019-09-27 19:53 joelsherrill   New Issue                                    
2019-09-27 19:53 joelsherrill   Name                      => Joel Sherrill   
2019-09-27 19:53 joelsherrill   Organization              => RTEMS.org       
2019-09-27 19:53 joelsherrill   Section                   => pthread.h and add
sys/cpuset.h
2019-09-27 19:53 joelsherrill   Page Number               => NA - addition
request
2019-09-27 19:53 joelsherrill   Line Number               => NA - addition
request
======================================================================


Reply via email to