Commit 2b594b49 authored by Xavier Thompson's avatar Xavier Thompson

scheduler.hpp: Rename parallelism into concurrency

parent 21b8f468
......@@ -32,7 +32,7 @@ namespace typon
std::vector<std::thread> _thread;
std::atomic_bool _done {false};
fdt::lock_free::event_count<> _notifyer;
const uint _parallelism;
const uint _concurrency;
static Scheduler & get() noexcept
{
......@@ -57,13 +57,13 @@ namespace typon
return get()._deque[thread_id].pop();
}
Scheduler(uint parallelism) noexcept
: _deque(parallelism + 1)
, _parallelism(parallelism)
Scheduler(uint concurrency) noexcept
: _deque(concurrency + 1)
, _concurrency(concurrency)
{
thread_id = parallelism;
thread_id = concurrency;
for (uint id = 0; id < parallelism; id++)
for (uint id = 0; id < concurrency; id++)
{
_thread.emplace_back([this, id]() {
thread_id = id;
......@@ -117,9 +117,9 @@ namespace typon
void explore_task(Task & task) noexcept
{
for (uint i = 0; i < _parallelism * 2 + 1; i++)
for (uint i = 0; i < _concurrency * 2 + 1; i++)
{
uint id = fdt::random::random() % _parallelism;
uint id = fdt::random::random() % _concurrency;
if (id == thread_id)
{
task = _deque.back().steal();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment