| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 072dd42 commit 6ec3d03
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,6 +26,10 @@ | |||
| 26 | 26 | \ | |
| 27 | 27 | std::cout << "Taskflow [speculative executor]: " \ | |
| 28 | 28 | << F<tf::BasicTaskflow<tf::SpeculativeThreadpool>>() \ | |
| 29 | + << " ms\n"; \ | ||
| 30 | + \ | ||
| 31 | + std::cout << "Taskflow [privatized executor]: " \ | ||
| 32 | + << F<tf::BasicTaskflow<tf::PrivatizedThreadpool>>() \ | ||
| 29 | 33 | << " ms\n"; \ | |
| 30 | 34 | ||
| 31 | 35 | // ============================================================================ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -535,19 +535,19 @@ void PrivatizedThreadpool<Closure>::emplace(ArgsT&&... args){ | |||
| 535 | 535 | // Privatized queue of worker. The lock-free queue is inspired by | |
| 536 | 536 | // http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue | |
| 537 | 537 | template<typename T, size_t C> | |
| 538 | - class PrivatizedClosureQueue { | ||
| 538 | + class PrivatizedWorkQueue { | ||
| 539 | 539 | ||
| 540 | 540 | public: | |
| 541 | 541 | ||
| 542 | - PrivatizedClosureQueue() : _buffer_mask(C - 1) { | ||
| 542 | + PrivatizedWorkQueue() : _buffer_mask(C - 1) { | ||
| 543 | 543 | for (size_t i = 0; i < C; i ++){ | |
| 544 | 544 | _buffer[i].sequence_.store(i, std::memory_order_relaxed); | |
| 545 | 545 | } | |
| 546 | 546 | _front.store(0, std::memory_order_relaxed); | |
| 547 | 547 | _back.store(0, std::memory_order_relaxed); | |
| 548 | 548 | } | |
| 549 | 549 | ||
| 550 | - ~PrivatizedClosureQueue(){} | ||
| 550 | + ~PrivatizedWorkQueue(){} | ||
| 551 | 551 | ||
| 552 | 552 | bool enqueue(T& data){ | |
| 553 | 553 | size_t pos = _front.load(std::memory_order_relaxed); | |
@@ -617,7 +617,7 @@ class PrivatizedThreadpool { | |||
| 617 | 617 | ||
| 618 | 618 | struct Worker{ | |
| 619 | 619 | std::condition_variable cv; | |
| 620 | - PrivatizedClosureQueue<Closure, 1024> queue; | ||
| 620 | + PrivatizedWorkQueue<Closure, 1024> queue; | ||
| 621 | 621 | std::optional<Closure> cache; | |
| 622 | 622 | bool exit {false}; | |
| 623 | 623 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments