Thrill  0.1

Detailed Description

Implementation of a local request queue having only one queue for both read and write requests, thus having only one thread.

Definition at line 32 of file request_queue_impl_1q.hpp.

+ Inheritance diagram for request_queue_impl_1q:
+ Collaboration diagram for request_queue_impl_1q:

#include <request_queue_impl_1q.hpp>

Public Member Functions

 request_queue_impl_1q (int n=1)
 
 ~request_queue_impl_1q ()
 
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...
 
virtual void set_priority_op (const priority_op &p)
 

Private Types

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

Static Private Member Functions

static void * worker (void *arg)
 

Private Attributes

queue_type queue_
 
std::mutex queue_mutex_
 
tlx::semaphore sem_
 
std::thread thread_
 
shared_state< thread_statethread_state_
 

Static Private Attributes

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 36 of file request_queue_impl_1q.hpp.

◆ self

using self = request_queue_impl_1q
private

Definition at line 35 of file request_queue_impl_1q.hpp.

Constructor & Destructor Documentation

◆ request_queue_impl_1q()

◆ ~request_queue_impl_1q()

Member Function Documentation

◆ add_request()

◆ cancel_request()

◆ set_priority_op()

void set_priority_op ( const priority_op op)
final

Definition at line 56 of file request_queue_impl_1q.cpp.

References tlx::unused().

◆ worker()

Member Data Documentation

◆ priority_op_

const priority_op priority_op_ = WRITE
staticprivate

Definition at line 45 of file request_queue_impl_1q.hpp.

◆ queue_

◆ queue_mutex_

std::mutex queue_mutex_
private

◆ sem_

◆ thread_

std::thread thread_
private

◆ thread_state_


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