Commit be2cdbfe by FritzFlorian

Allow for switching deque implementation.

parent 7b61f2e0
Pipeline #1249 failed with stages
in 1 minute 22 seconds
#ifndef PLS_DEQUE_H_
#define PLS_DEQUE_H_
#include "work_stealing_deque.h"
#include "locking_deque.h"
namespace pls {
namespace internal {
namespace data_structures {
template<typename Item>
using deque = work_stealing_deque<Item>;
}
}
}
#endif //PLS_DEQUE_H_
...@@ -70,7 +70,7 @@ class locking_deque { ...@@ -70,7 +70,7 @@ class locking_deque {
deque_item->next_ = nullptr; deque_item->next_ = nullptr;
tail_ = deque_item; tail_ = deque_item;
return deque_item->item_; return &deque_item->content_;
} }
Item *pop_tail() { Item *pop_tail() {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "pls/internal/helpers/profiler.h" #include "pls/internal/helpers/profiler.h"
#include "pls/internal/data_structures/aligned_stack.h" #include "pls/internal/data_structures/aligned_stack.h"
#include "pls/internal/data_structures/work_stealing_deque.h" #include "pls/internal/data_structures/deque.h"
#include "pls/internal/scheduling/thread_state.h" #include "pls/internal/scheduling/thread_state.h"
...@@ -21,7 +21,7 @@ class task { ...@@ -21,7 +21,7 @@ class task {
task *parent_; task *parent_;
// Stack Management (reset stack pointer after wait_for_all() calls) // Stack Management (reset stack pointer after wait_for_all() calls)
data_structures::work_stealing_deque<task>::state deque_state_; data_structures::deque<task>::state deque_state_;
protected: protected:
// TODO: Double Check with copy and move constructors, try to minimize overhead while keeping a clean API. // TODO: Double Check with copy and move constructors, try to minimize overhead while keeping a clean API.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "pls/internal/base/thread.h" #include "pls/internal/base/thread.h"
#include "pls/internal/data_structures/aligned_stack.h" #include "pls/internal/data_structures/aligned_stack.h"
#include "pls/internal/data_structures/work_stealing_deque.h" #include "pls/internal/data_structures/deque.h"
namespace pls { namespace pls {
namespace internal { namespace internal {
...@@ -21,7 +21,7 @@ struct thread_state { ...@@ -21,7 +21,7 @@ struct thread_state {
alignas(base::system_details::CACHE_LINE_SIZE) scheduler *scheduler_; alignas(base::system_details::CACHE_LINE_SIZE) scheduler *scheduler_;
alignas(base::system_details::CACHE_LINE_SIZE) task *current_task_; alignas(base::system_details::CACHE_LINE_SIZE) task *current_task_;
alignas(base::system_details::CACHE_LINE_SIZE) data_structures::aligned_stack *task_stack_; alignas(base::system_details::CACHE_LINE_SIZE) data_structures::aligned_stack *task_stack_;
alignas(base::system_details::CACHE_LINE_SIZE) data_structures::work_stealing_deque<task> deque_; alignas(base::system_details::CACHE_LINE_SIZE) data_structures::deque<task> deque_;
alignas(base::system_details::CACHE_LINE_SIZE) size_t id_; alignas(base::system_details::CACHE_LINE_SIZE) size_t id_;
alignas(base::system_details::CACHE_LINE_SIZE) std::minstd_rand random_; alignas(base::system_details::CACHE_LINE_SIZE) std::minstd_rand random_;
......
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 sign in to comment