job/queue: expose default_parallelism query
This commit is contained in:
parent
976d44b1d9
commit
e0f4fdc308
@ -15,8 +15,8 @@ using cruft::job::queue;
|
|||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
static unsigned
|
unsigned
|
||||||
default_parallelism (void)
|
queue::default_parallelism (void) noexcept
|
||||||
{
|
{
|
||||||
if (auto var = getenv ("JOB_THREADS")) {
|
if (auto var = getenv ("JOB_THREADS")) {
|
||||||
return cruft::from_string<unsigned> (var);
|
return cruft::from_string<unsigned> (var);
|
||||||
|
@ -42,6 +42,8 @@ namespace cruft::job {
|
|||||||
queue& operator= (const queue&) = delete;
|
queue& operator= (const queue&) = delete;
|
||||||
queue& operator= (queue&&) = delete;
|
queue& operator= (queue&&) = delete;
|
||||||
|
|
||||||
|
static unsigned default_parallelism (void) noexcept;
|
||||||
|
|
||||||
auto parallelism (void) const { return m_threads.size (); }
|
auto parallelism (void) const { return m_threads.size (); }
|
||||||
auto capacity (void) const { return m_tasks.store.capacity (); }
|
auto capacity (void) const { return m_tasks.store.capacity (); }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user