File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 \
2727 std::cout << " Taskflow [speculative executor]: " \
2828 << F<tf::BasicTaskflow<tf::SpeculativeThreadpool>>() \
29+ << " ms\n " ; \
30+ \
31+ std::cout << " Taskflow [privatized executor]: " \
32+ << F<tf::BasicTaskflow<tf::PrivatizedThreadpool>>() \
2933 << " ms\n " ; \
3034
3135// ============================================================================
Original file line number Diff line number Diff line change @@ -535,19 +535,19 @@ void PrivatizedThreadpool<Closure>::emplace(ArgsT&&... args){
535535// Privatized queue of worker. The lock-free queue is inspired by
536536// http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue
537537template <typename T, size_t C>
538- class PrivatizedClosureQueue {
538+ class PrivatizedWorkQueue {
539539
540540 public:
541541
542- PrivatizedClosureQueue () : _buffer_mask(C - 1 ) {
542+ PrivatizedWorkQueue () : _buffer_mask(C - 1 ) {
543543 for (size_t i = 0 ; i < C; i ++){
544544 _buffer[i].sequence_ .store (i, std::memory_order_relaxed);
545545 }
546546 _front.store (0 , std::memory_order_relaxed);
547547 _back.store (0 , std::memory_order_relaxed);
548548 }
549549
550- ~PrivatizedClosureQueue (){}
550+ ~PrivatizedWorkQueue (){}
551551
552552 bool enqueue (T& data){
553553 size_t pos = _front.load (std::memory_order_relaxed);
@@ -617,7 +617,7 @@ class PrivatizedThreadpool {
617617
618618 struct Worker {
619619 std::condition_variable cv;
620- PrivatizedClosureQueue <Closure, 1024 > queue;
620+ PrivatizedWorkQueue <Closure, 1024 > queue;
621621 std::optional<Closure> cache;
622622 bool exit {false };
623623
You can’t perform that action at this time.
0 commit comments