14 #ifndef FOXXLL_IO_LINUXAIO_QUEUE_HEADER 15 #define FOXXLL_IO_LINUXAIO_QUEUE_HEADER 19 #if FOXXLL_HAVE_LINUXAIO_FILE 21 #include <linux/aio_abi.h> 37 class linuxaio_queue :
public request_queue_impl_worker
39 constexpr
static bool debug =
false;
41 friend class linuxaio_request;
43 using self_type = linuxaio_queue;
47 aio_context_t context_;
50 using queue_type = std::list<request_ptr>;
54 std::mutex waiting_mtx_;
55 queue_type waiting_requests_;
60 tlx::semaphore num_waiting_requests_, num_free_events_, num_posted_requests_;
63 std::thread post_thread_, wait_thread_;
64 shared_state<thread_state> post_thread_state_, wait_thread_state_;
74 static const priority_op priority_op_ = WRITE;
76 static void * post_async(
void* arg);
77 static void * wait_async(
void* arg);
79 void handle_events(io_event* events,
long num_events,
bool canceled);
84 aio_context_t get_io_context() {
return context_; }
89 explicit linuxaio_queue(
int desired_queue_length = 0);
101 #endif // #if FOXXLL_HAVE_LINUXAIO_FILE 103 #endif // !FOXXLL_IO_LINUXAIO_QUEUE_HEADER A simple semaphore implementation using C++11 synchronization methods.
tlx::counting_ptr< request > request_ptr
A reference counting pointer for request.
static constexpr bool debug