diff options
Diffstat (limited to 'src/core/support/cpu_posix.c')
-rw-r--r-- | src/core/support/cpu_posix.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/core/support/cpu_posix.c b/src/core/support/cpu_posix.c index 5f45fb0bc3..1844e9a622 100644 --- a/src/core/support/cpu_posix.c +++ b/src/core/support/cpu_posix.c @@ -42,8 +42,6 @@ #include <grpc/support/log.h> #include <grpc/support/sync.h> -static __thread char magic_thread_local; - static int ncpus = 0; static void init_ncpus() { @@ -60,18 +58,10 @@ unsigned gpr_cpu_num_cores(void) { return ncpus; } -/* This is a cheap, but good enough, pointer hash for sharding things: */ -static size_t shard_ptr(const void *info) { - size_t x = (size_t)info; - return ((x >> 4) ^ (x >> 9) ^ (x >> 14)) % gpr_cpu_num_cores(); -} - unsigned gpr_cpu_current_cpu(void) { /* NOTE: there's no way I know to return the actual cpu index portably... - most code that's using this is using it to shard across work queues though, - so here we use thread identity instead to achieve a similar though not - identical effect */ - return shard_ptr(&magic_thread_local); + most code that's using this is using it to shard across work queues though */ + return 0; } #endif /* GPR_CPU_LINUX */ |