Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
request_queue_impl_qwqr Class Referencefinal

Detailed Description

Implementation of a local request queue having two queues, one for read and one for write requests, thus having two threads. This is the default implementation.

Definition at line 34 of file request_queue_impl_qwqr.hpp.

+ Inheritance diagram for request_queue_impl_qwqr:
+ Collaboration diagram for request_queue_impl_qwqr:

#include <request_queue_impl_qwqr.hpp>

Public Member Functions

 request_queue_impl_qwqr (int n=1)
 ~request_queue_impl_qwqr ()
void add_request (request_ptr &req) final
bool cancel_request (request_ptr &req) final
void set_priority_op (const priority_op &op) final
- Public Member Functions inherited from request_queue
 request_queue ()=default
 request_queue (const request_queue &)=delete
 non-copyable: delete copy-constructor More...
 request_queue (request_queue &&)=default
 move-constructor: default More...
virtual ~request_queue ()
request_queueoperator= (const request_queue &)=delete
 non-copyable: delete assignment operator More...
request_queueoperator= (request_queue &&)=default
 move-assignment operator: default More...

Private Types

using queue_type = std::list< request_ptr >
using self = request_queue_impl_qwqr

Static Private Member Functions

static void * worker (void *arg)

Private Attributes

std::mutex read_mutex_
queue_type read_queue_
tlx::semaphore sem_
std::thread thread_
shared_state< thread_statethread_state_
std::mutex write_mutex_
queue_type write_queue_

Static Private Attributes

static constexpr bool debug = false
static const priority_op priority_op_ = WRITE

Additional Inherited Members

- Public Types inherited from request_queue
enum  priority_op { READ, WRITE, NONE }
- Protected Types inherited from request_queue_impl_worker
- Protected Member Functions inherited from request_queue_impl_worker
void start_thread (void *(*worker)(void *), void *arg, std::thread &t, shared_state< thread_state > &s)
void stop_thread (std::thread &t, shared_state< thread_state > &s, tlx::semaphore &sem)

Member Typedef Documentation

using queue_type = std::list<request_ptr>

Definition at line 40 of file request_queue_impl_qwqr.hpp.

using self = request_queue_impl_qwqr

Definition at line 39 of file request_queue_impl_qwqr.hpp.

Constructor & Destructor Documentation

Member Function Documentation

void set_priority_op ( const priority_op op)

Reimplemented from request_queue.

Definition at line 55 of file request_queue_impl_qwqr.cpp.

References tlx::unused().

Member Data Documentation

constexpr bool debug = false

Definition at line 36 of file request_queue_impl_qwqr.hpp.

const priority_op priority_op_ = WRITE

Definition at line 51 of file request_queue_impl_qwqr.hpp.

std::mutex read_mutex_
std::mutex write_mutex_

The documentation for this class was generated from the following files: