Skip to content

Commit

Permalink
PR Fixed segfault in Nexus::Nexus when there are offline CPUs erpc-io#36
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo committed Sep 16, 2020
1 parent e62ac49 commit e8d1ff8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/nexus_impl/nexus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,14 @@ Nexus::Nexus(std::string local_uri, size_t numa_node, size_t num_bg_threads)
sm_thread_ctx.reg_hooks_lock = &reg_hooks_lock;

// Bind the session management thread to the last lcore on numa_node
size_t sm_thread_lcore_index = num_lcores_per_numa_node() - 1;
//size_t sm_thread_lcore_index = num_lcores_per_numa_node() - 1;
auto lcores = get_lcores_for_numa_node(numa_node);
ERPC_INFO("eRPC Nexus: Launching session management thread on core %zu.\n",
get_lcores_for_numa_node(numa_node).at(sm_thread_lcore_index));
//get_lcores_for_numa_node(numa_node).at(sm_thread_lcore_index));
lcores.back());
sm_thread = std::thread(sm_thread_func, sm_thread_ctx);
bind_to_core(sm_thread, numa_node, sm_thread_lcore_index);
//bind_to_core(sm_thread, numa_node, sm_thread_lcore_index);
bind_to_core(sm_thread, numa_node, lcores.size() - 1);

ERPC_INFO("eRPC Nexus: Created with management UDP port %u, hostname %s.\n",
sm_udp_port, hostname.c_str());
Expand Down

0 comments on commit e8d1ff8

Please sign in to comment.