104 | | == Future Directions == |
105 | | |
106 | | |
107 | | Implement the missing feature. This consists of two parts |
108 | | |
109 | | * the application level API, and |
110 | | * the scheduler support. |
111 | | |
112 | | There is no POSIX API available that covers thread processor affinity. Linux |
113 | | is the de facto standard system for high performance computing so it is |
114 | | obvious to choose a Linux compatible API for RTEMS. Linux provides |
115 | | [http://man7.org/linux/man-pages/man3/CPU_SET.3.html CPU_SET(3)] to manage sets |
116 | | of processors. Thread processor affinity can be controlled via |
| 104 | == Background == |
| 105 | |
| 106 | |
| 107 | There are multiple pieces of work involved in supporting thread processor affinity |
| 108 | |
| 109 | * the POSIX application level API, |
| 110 | * the Classic application level API, |
| 111 | * scheduler framework modifications, and |
| 112 | * actual scheduler support. |
| 113 | |
| 114 | There is no POSIX API available that covers thread processor affinity. Linux is the de facto standard system for high performance computing so it is obvious to choose a Linux compatible API for RTEMS. Linux provides |
| 115 | [http://man7.org/linux/man-pages/man3/CPU_SET.3.html CPU_SET(3)] to manage sets of processors. Thread processor affinity can be controlled via |
1501 | | One approach to do post-switch actions could be to spin on the per-processor |
1502 | | variable reflecting the executing thread. This has at least two problems |
1503 | | # it doesn't work if the executing thread wants to alter its own state, and |
1504 | | # this spinning must be done with the scheduler lock held and interrupts disabled, this is a disaster for the interrupt latency, |
1505 | | |
1506 | | The proposed solution is to use an optional action handler which is active in |
1507 | | case the thread execution termination matters. In _Thread_Dispatch() we have |
1508 | | already the post-switch extensions invoked after a thread switch. |
1509 | | Unfortunately they execute after thread dispatching is enabled again and at |
1510 | | this point the current processor may have already changed |
| 1504 | One approach to do post-switch actions could be to spin o |