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

scheduler.hpp: Rename parallelism into concurrency

parent 21b8f468
...@@ -32,7 +32,7 @@ namespace typon ...@@ -32,7 +32,7 @@ namespace typon
std::vector<std::thread> _thread; std::vector<std::thread> _thread;
std::atomic_bool _done {false}; std::atomic_bool _done {false};
fdt::lock_free::event_count<> _notifyer; fdt::lock_free::event_count<> _notifyer;
const uint _parallelism; const uint _concurrency;
static Scheduler & get() noexcept static Scheduler & get() noexcept
{ {
...@@ -57,13 +57,13 @@ namespace typon ...@@ -57,13 +57,13 @@ namespace typon
return get()._deque[thread_id].pop(); return get()._deque[thread_id].pop();
} }
Scheduler(uint parallelism) noexcept Scheduler(uint concurrency) noexcept
: _deque(parallelism + 1) : _deque(concurrency + 1)
, _parallelism(parallelism) , _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.emplace_back([this, id]() {
thread_id = id; thread_id = id;
...@@ -117,9 +117,9 @@ namespace typon ...@@ -117,9 +117,9 @@ namespace typon
void explore_task(Task & task) noexcept 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) if (id == thread_id)
{ {
task = _deque.back().steal(); 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