Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:57:52

0001 //
0002 // MIT License
0003 // Copyright (c) 2020 Jonathan R. Madsen
0004 // Permission is hereby granted, free of charge, to any person obtaining a copy
0005 // of this software and associated documentation files (the "Software"), to deal
0006 // in the Software without restriction, including without limitation the rights
0007 // to use, copy, modify, merge, publish, distribute, sublicense, and
0008 // copies of the Software, and to permit persons to whom the Software is
0009 // furnished to do so, subject to the following conditions:
0010 // The above copyright notice and this permission notice shall be included in
0011 // all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
0012 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
0013 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
0014 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0015 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
0016 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
0017 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0018 //
0019 // ---------------------------------------------------------------
0020 // Tasking class header file
0021 //
0022 // Class Description:
0023 //
0024 
0025 //======================================================================================//
0026 
0027 #pragma once
0028 
0029 #include "PTL/Types.hh"
0030 
0031 namespace PTL
0032 {
0033 namespace Threading
0034 {
0035 enum
0036 {
0037     SEQUENTIAL_ID    = -2,
0038     MASTER_ID        = -1,
0039     WORKER_ID        = 0,
0040     GENERICTHREAD_ID = -1000
0041 };
0042 }
0043 
0044 Pid_t
0045 GetPidId();
0046 
0047 unsigned
0048 GetNumberOfPhysicalCpus();
0049 
0050 unsigned
0051 GetNumberOfCores();
0052 
0053 int
0054 GetThreadId();
0055 
0056 void
0057 SetThreadId(int aNewValue);
0058 
0059 bool
0060 SetPinAffinity(int idx);
0061 
0062 bool
0063 SetThreadPriority(int _v);
0064 
0065 bool
0066 SetPinAffinity(int idx, NativeThread& _t);
0067 
0068 bool
0069 SetThreadPriority(int _v, NativeThread& _t);
0070 
0071 }  // namespace PTL