Skip to content

Commit

Permalink
Back up to number of jobs being the same as logical cores, affinity l…
Browse files Browse the repository at this point in the history
…ocked to physical cores still
  • Loading branch information
vk2gpu committed Feb 20, 2018
1 parent e3c5632 commit 403652b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/app_common/test_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace

i32 GetNumJobWorkers(const Core::CommandLine& cmdLine)
{
i32 numWorkers = Core::GetNumPhysicalCores();
i32 numWorkers = Core::GetNumLogicalCores();
Core::String val;
if(cmdLine.GetArg(0, "jobworkers", val))
numWorkers = atoi(val.c_str());
Expand Down
5 changes: 4 additions & 1 deletion src/job/private/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ namespace Job
// Create thread.
auto debugName = Core::String().Printf("Job Worker Thread %i", idx);
thread_ = Core::Thread(ThreadEntryPoint, this, Core::Thread::DEFAULT_STACK_SIZE, debugName.c_str());
if(u64 mask = Core::GetPhysicalCoreAffinityMask(idx))

// Set thread affinity to physical cores.
const i32 numPhysCores = Core::GetNumPhysicalCores();
if(u64 mask = Core::GetPhysicalCoreAffinityMask(idx) % numPhysCores)
thread_.SetAffinity(mask);
}

Expand Down

0 comments on commit 403652b

Please sign in to comment.