Skip to content

Commit

Permalink
Remove spawn function
Browse files Browse the repository at this point in the history
  • Loading branch information
Rombur committed Oct 26, 2023
1 parent bb759df commit a417450
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
13 changes: 2 additions & 11 deletions core/src/Threads/Kokkos_Threads_Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,6 @@ inline unsigned fan_size(const unsigned rank, const unsigned size) {
namespace Kokkos {
namespace Impl {

//----------------------------------------------------------------------------
// Spawn a thread

void ThreadsInternal::spawn() {
std::thread t(internal_cppthread_driver);
t.detach();
}

//----------------------------------------------------------------------------

bool ThreadsInternal::is_process() {
static const std::thread::id master_pid = std::this_thread::get_id();

Expand Down Expand Up @@ -592,7 +582,8 @@ void ThreadsInternal::initialize(int thread_count_arg) {
// Wait until spawned thread has attempted to initialize.
// If spawning and initialization is successful then
// an entry in 's_threads_exec' will be assigned.
ThreadsInternal::spawn();
std::thread t(internal_cppthread_driver);
t.detach();
wait_yield(s_threads_process.m_pool_state, ThreadState::Inactive);
if (s_threads_process.m_pool_state == ThreadState::Terminating) break;
}
Expand Down
1 change: 0 additions & 1 deletion core/src/Threads/Kokkos_Threads_Instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class ThreadsInternal {

static void global_lock();
static void global_unlock();
static void spawn();

static void first_touch_allocate_thread_private_scratch(ThreadsInternal &,
const void *);
Expand Down

0 comments on commit a417450

Please sign in to comment.