Thrill  0.1

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
enum  thread_state { NOT_RUNNING, RUNNING, TERMINATING, TERMINATED }
 
- 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

◆ queue_type

using queue_type = std::list<request_ptr>
private

Definition at line 40 of file request_queue_impl_qwqr.hpp.

◆ self

using self = request_queue_impl_qwqr
private

Definition at line 39 of file request_queue_impl_qwqr.hpp.

Constructor & Destructor Documentation

◆ request_queue_impl_qwqr()

◆ ~request_queue_impl_qwqr()

Member Function Documentation

◆ add_request()

◆ cancel_request()

◆ set_priority_op()

void set_priority_op ( const priority_op op)
finalvirtual

Reimplemented from request_queue.

Definition at line 55 of file request_queue_impl_qwqr.cpp.

References tlx::unused().

◆ worker()

Member Data Documentation

◆ debug

constexpr bool debug = false
staticprivate

Definition at line 36 of file request_queue_impl_qwqr.hpp.

◆ priority_op_

const priority_op priority_op_ = WRITE
staticprivate

Definition at line 51 of file request_queue_impl_qwqr.hpp.

◆ read_mutex_

std::mutex read_mutex_
private

◆ read_queue_

◆ sem_

◆ thread_

◆ thread_state_

◆ write_mutex_

std::mutex write_mutex_
private

◆ write_queue_


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