Skip to content

Commit

Permalink
Rename new function and clarify purpose
Browse files Browse the repository at this point in the history
After discussion with phillman, renamed to give this routine a purpose
beyond some soon to be deleted legacy support, and clarified this in the
comment documenting the function.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Jul 18, 2019
1 parent 23eaf0f commit e8dc432
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion IlmBase/IlmThread/IlmThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ ThreadPool::addGlobalTask (Task* task)
}

unsigned
ThreadPool::hardwareConcurrency ()
ThreadPool::estimateThreadCountForFileIO ()
{
#ifdef ILMBASE_FORCE_CXX03
# if defined(_WIN32)
Expand Down
16 changes: 10 additions & 6 deletions IlmBase/IlmThread/IlmThreadPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,17 @@ class ILMTHREAD_EXPORT ThreadPool
{
public:
//-------------------------------------------------------
// static routine to query how many processors are currently
// online / suggested. This gives no indication of load
// balancing with other threads that may be active in the
// application / system. When compiling for >= c++11 this
// is the same as hardware_concurrency
// static routine to query how many processors should be
// used for processing exr files. The user of ThreadPool
// is free to use std::thread::hardware_concurrency or
// whatever number of threads is appropriate based on the
// application. However, this routine exists such that
// in the future, if core counts expand faster than
// memory bandwidth, or higher order NUMA machines are built
// that we can query, this routine gives a place where we
// can centralize that logic
//-------------------------------------------------------
static unsigned hardwareConcurrency ();
static unsigned estimateThreadCountForFileIO ();

//-------------------------------------------------------
// Constructor -- creates numThreads worker threads which
Expand Down

0 comments on commit e8dc432

Please sign in to comment.