|
|
|
@ -34,19 +34,17 @@ |
|
|
|
|
#include <grpc/support/port_platform.h> |
|
|
|
|
|
|
|
|
|
#ifdef GPR_WIN32 |
|
|
|
|
|
|
|
|
|
#include <Windows.h> |
|
|
|
|
#include <grpc/support/log.h> |
|
|
|
|
|
|
|
|
|
unsigned gpr_cpu_num_cores(void) { |
|
|
|
|
/* TODO(jtattermusch): implement */ |
|
|
|
|
gpr_log(GPR_ERROR, "Cannot determine number of CPUs: assuming 1"); |
|
|
|
|
return 1; |
|
|
|
|
SYSTEM_INFO si; |
|
|
|
|
GetSystemInfo(&si); |
|
|
|
|
return si.dwNumberOfProcessors; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned gpr_cpu_current_cpu(void) { |
|
|
|
|
/* TODO(jtattermusch): implement */ |
|
|
|
|
gpr_log(GPR_ERROR, "Cannot determine current CPU"); |
|
|
|
|
return 0; |
|
|
|
|
return GetCurrentProcessorNumber(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endif /* GPR_WIN32 */ |
|
|
|
|