Geant4 Cross Reference |
1 // 2 // MIT License 3 // Copyright (c) 2020 Jonathan R. Madsen 4 // Permission is hereby granted, free of charge, to any person obtaining a copy 5 // of this software and associated documentation files (the "Software"), to deal 6 // in the Software without restriction, including without limitation the rights 7 // to use, copy, modify, merge, publish, distribute, sublicense, and 8 // copies of the Software, and to permit persons to whom the Software is 9 // furnished to do so, subject to the following conditions: 10 // The above copyright notice and this permission notice shall be included in 11 // all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 12 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 13 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 14 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 15 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 16 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 17 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 // 19 // --------------------------------------------------------------- 20 // Tasking class header file 21 // 22 // Class Description: 23 // 24 25 //======================================================================================// 26 27 #pragma once 28 29 #include "PTL/Types.hh" 30 31 namespace PTL 32 { 33 namespace Threading 34 { 35 enum 36 { 37 SEQUENTIAL_ID = -2, 38 MASTER_ID = -1, 39 WORKER_ID = 0, 40 GENERICTHREAD_ID = -1000 41 }; 42 } 43 44 Pid_t 45 GetPidId(); 46 47 unsigned 48 GetNumberOfPhysicalCpus(); 49 50 unsigned 51 GetNumberOfCores(); 52 53 int 54 GetThreadId(); 55 56 void 57 SetThreadId(int aNewValue); 58 59 bool 60 SetPinAffinity(int idx); 61 62 bool 63 SetThreadPriority(int _v); 64 65 bool 66 SetPinAffinity(int idx, NativeThread& _t); 67 68 bool 69 SetThreadPriority(int _v, NativeThread& _t); 70 71 } // namespace PTL 72