aboutsummaryrefslogtreecommitdiff
path: root/CPP/Windows/System.h
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/Windows/System.h')
-rw-r--r--CPP/Windows/System.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/CPP/Windows/System.h b/CPP/Windows/System.h
index 0c80373..041a44d 100644
--- a/CPP/Windows/System.h
+++ b/CPP/Windows/System.h
@@ -15,6 +15,8 @@
15namespace NWindows { 15namespace NWindows {
16namespace NSystem { 16namespace NSystem {
17 17
18UInt32 GetNumberOfProcessors();
19
18#ifdef _WIN32 20#ifdef _WIN32
19 21
20struct CCpuGroups 22struct CCpuGroups
@@ -103,6 +105,25 @@ struct CProcessAffinity
103 return CountAffinity(systemAffinityMask); 105 return CountAffinity(systemAffinityMask);
104 } 106 }
105 107
108 // it returns normilized number of threads
109 void Get_and_return_NumProcessThreads_and_SysThreads(UInt32 &numProcessThreads, UInt32 &numSysThreads)
110 {
111 UInt32 num1 = 0, num2 = 0;
112 if (Get())
113 {
114 num1 = GetNumProcessThreads();
115 num2 = GetNumSystemThreads();
116 }
117 if (num1 == 0)
118 num1 = NSystem::GetNumberOfProcessors();
119 if (num1 == 0)
120 num1 = 1;
121 if (num2 < num1)
122 num2 = num1;
123 numProcessThreads = num1;
124 numSysThreads = num2;
125 }
126
106 BOOL Get(); 127 BOOL Get();
107 128
108 BOOL SetProcAffinity() const 129 BOOL SetProcAffinity() const
@@ -177,8 +198,6 @@ struct CProcessAffinity
177#endif // _WIN32 198#endif // _WIN32
178 199
179 200
180UInt32 GetNumberOfProcessors();
181
182bool GetRamSize(size_t &size); // returns false, if unknown ram size 201bool GetRamSize(size_t &size); // returns false, if unknown ram size
183 202
184unsigned long Get_File_OPEN_MAX(); 203unsigned long Get_File_OPEN_MAX();