Skip to content

Commit

Permalink
No affinity on Android: #156
Browse files Browse the repository at this point in the history
  • Loading branch information
mratsim committed Mar 7, 2021
1 parent 5c0b29d commit d0c6403
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions weave/primitives/affinity_posix.nim
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ proc cpu_set(cpu: cint, cpuset: var CpuSet) {.importc: "CPU_SET", header: "<sche
# Nim doesn't allow the main thread to set its own affinity

proc set_thread_affinity(t: Pthread, cpu: int32) {.inline.}=
when defined(osx):
when defined(osx) or defined(android):
{.warning: "To improve performance we should pin threads to cores.\n" &
"This is not possible with MacOS.".}
"This is not possible with MacOS or Android.".}
# Note: on Android it's even more complex due to the Big.Little architecture
# with cores with different performance profiles to save on battery
else:
var cpuset {.noinit.}: CpuSet

Expand Down

0 comments on commit d0c6403

Please sign in to comment.