13#ifndef BOOST_FAIRNESS_REQUEST_POOL_HPP
14#define BOOST_FAIRNESS_REQUEST_POOL_HPP
25 struct alignas(BOOST_FAIRNESS_HARDWARE_DESTRUCTIVE_SIZE)
Request{
30 std::atomic_flag inUse_{};
36 state_.store(
PENDING, std::memory_order_relaxed);
58 for (uint32_t i = 0; i < N; ++i){
59 if (!reqs_[i].inUse_.test(std::memory_order_relaxed) && !reqs_[i].inUse_.test_and_set(std::memory_order_acquire))
68 req->
inUse_.clear(std::memory_order_release);
73 std::array<Request, N> reqs_{};
Definition request_pool.hpp:50
void returnRequest(Request *const req)
Definition request_pool.hpp:66
Request * getRequest()
Definition request_pool.hpp:57
This file contains configurations about boost and 128bit cpu support. TODO.
#define BOOST_FAIRNESS_HARDWARE_DESTRUCTIVE_SIZE
Size to be aligned to avoid false sharing
Definition config.hpp:85
Definition coherent_priority_lock.hpp:25
void spin_wait(T &mem, K const expected) noexcept
Definition wait_ops.hpp:29
#define PENDING
Definition request_pool.hpp:20
Definition request_pool.hpp:25
void reset()
Definition request_pool.hpp:35
std::atomic_flag inUse_
Definition request_pool.hpp:30
Definition thread_pool.hpp:24