Skip to content

Commit

Permalink
Delete global_thread_pool
Browse files Browse the repository at this point in the history
This was apparently used for parallel linking at some point but was
dummied out for mysterious reasons. Even without that, I suspect
that the thread pool wouldn't need to be global.
  • Loading branch information
Bike committed Jul 27, 2023
1 parent 760aa5b commit a02ece5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions src/gctools/threadlocal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
THREAD_LOCAL gctools::ThreadLocalStateLowLevel* my_thread_low_level;
THREAD_LOCAL core::ThreadLocalState* my_thread;

namespace gctools {
thread_pool<ThreadManager>* global_thread_pool;
};
namespace core {

#ifdef DEBUG_VIRTUAL_MACHINE
Expand Down Expand Up @@ -244,11 +241,7 @@ pid_t ThreadLocalState::safe_fork()
{
// Wrap fork in code that turns guards off and on
this->_VM.disable_guards();
// shut down llvm thread pool
gctools::global_thread_pool->~thread_pool();
pid_t result = fork();
// start up llvm thread pool
gctools::global_thread_pool = new thread_pool<ThreadManager>(thread_pool<ThreadManager>::sane_number_of_threads());
if (result==-1) {
// error
printf("%s:%d:%s fork failed errno = %d\n", __FILE__, __LINE__, __FUNCTION__, errno );
Expand Down
2 changes: 1 addition & 1 deletion src/llvmo/runtimeJit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,8 @@ namespace llvmo {
/*! Call this after fork() to create a thread-pool for lljit
*/
CL_DEFUN void llvm_sys__create_lljit_thread_pool() {
gctools::global_thread_pool = new thread_pool<ThreadManager>(thread_pool<ThreadManager>::sane_number_of_threads());
#if 0
gctools::global_thread_pool = new thread_pool<ThreadManager>(thread_pool<ThreadManager>::sane_number_of_threads());
ClaspJIT_O* jit = &*gctools::As<ClaspJIT_sp>(_lisp->_Roots._ClaspJIT);
jit->_LLJIT->getExecutionSession().setDispatchTask([jit](std::unique_ptr<Task> T) {
DEBUG_OBJECT_FILES_PRINT(("%s:%d:%s pushing an LLJIT task\n", __FILE__, __LINE__, __FUNCTION__ ));
Expand Down

0 comments on commit a02ece5

Please sign in to comment.