STXXL
1.4-dev
|
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 32 of file request_queue_impl_qwqr.h.
Public Member Functions | |
request_queue_impl_qwqr (int n=1) | |
~request_queue_impl_qwqr () | |
void | add_request (request_ptr &req) |
bool | cancel_request (request_ptr &req) |
void | set_priority_op (priority_op op) |
Public Member Functions inherited from stxxl::request_queue | |
virtual | ~request_queue () noexcept(false) |
virtual void | set_priority_op (priority_op p) |
Private Types | |
typedef std::list< request_ptr > | queue_type |
typedef request_queue_impl_qwqr | self |
Static Private Member Functions | |
static void * | worker (void *arg) |
Private Attributes | |
mutex | m_read_mutex |
queue_type | m_read_queue |
semaphore | m_sem |
thread_type | m_thread |
state< thread_state > | m_thread_state |
mutex | m_write_mutex |
queue_type | m_write_queue |
Static Private Attributes | |
static const priority_op | m_priority_op = WRITE |
Additional Inherited Members | |
Public Types inherited from stxxl::request_queue | |
enum | priority_op { READ, WRITE, NONE } |
Protected Types inherited from stxxl::request_queue_impl_worker | |
enum | thread_state { NOT_RUNNING, RUNNING, TERMINATING, TERMINATED } |
typedef pthread_t | thread_type |
Protected Member Functions inherited from stxxl::request_queue_impl_worker | |
void | start_thread (void *(*worker)(void *), void *arg, thread_type &t, state< thread_state > &s) |
void | stop_thread (thread_type &t, state< thread_state > &s, semaphore &sem) |
|
private |
Definition at line 36 of file request_queue_impl_qwqr.h.
|
private |
Definition at line 35 of file request_queue_impl_qwqr.h.
stxxl::request_queue_impl_qwqr::request_queue_impl_qwqr | ( | int | n = 1 | ) |
Definition at line 45 of file request_queue_impl_qwqr.cpp.
References m_thread, m_thread_state, stxxl::request_queue_impl_worker::start_thread(), stxxl::STXXL_UNUSED(), and worker().
stxxl::request_queue_impl_qwqr::~request_queue_impl_qwqr | ( | ) |
Definition at line 137 of file request_queue_impl_qwqr.cpp.
References m_sem, m_thread, m_thread_state, and stxxl::request_queue_impl_worker::stop_thread().
|
virtual |
Implements stxxl::request_queue.
Definition at line 52 of file request_queue_impl_qwqr.cpp.
References _STXXL_FORCE_SEQUENTIAL, stxxl::counting_ptr< Type >::empty(), stxxl::counting_ptr< Type >::get(), stxxl::request::get_type(), m_read_mutex, m_read_queue, m_sem, m_thread_state, m_write_mutex, m_write_queue, stxxl::request_interface::READ, stxxl::request_queue_impl_worker::RUNNING, STXXL_ERRMSG, and STXXL_THROW_INVALID_ARGUMENT.
|
virtual |
Implements stxxl::request_queue.
Definition at line 97 of file request_queue_impl_qwqr.cpp.
References _STXXL_FORCE_SEQUENTIAL, stxxl::counting_ptr< Type >::empty(), stxxl::find(), stxxl::counting_ptr< Type >::get(), stxxl::request::get_type(), m_read_mutex, m_read_queue, m_sem, m_thread_state, m_write_mutex, m_write_queue, stxxl::request_interface::READ, stxxl::request_queue_impl_worker::RUNNING, STXXL_ERRMSG, and STXXL_THROW_INVALID_ARGUMENT.
|
inline |
Definition at line 59 of file request_queue_impl_qwqr.h.
References stxxl::STXXL_UNUSED().
|
staticprivate |
Definition at line 142 of file request_queue_impl_qwqr.cpp.
References stxxl::counting_ptr< Type >::get(), stxxl::atomic_counted_object::get_reference_count(), m_sem, stxxl::request_queue::NONE, stxxl::request_queue::READ, STXXL_VERBOSE2, stxxl::request_queue_impl_worker::TERMINATED, stxxl::request_queue_impl_worker::TERMINATING, stxxl::scoped_mutex_lock::unlock(), and stxxl::request_queue::WRITE.
Referenced by request_queue_impl_qwqr().
|
staticprivate |
Definition at line 47 of file request_queue_impl_qwqr.h.
|
private |
Definition at line 39 of file request_queue_impl_qwqr.h.
Referenced by add_request(), and cancel_request().
|
private |
Definition at line 41 of file request_queue_impl_qwqr.h.
Referenced by add_request(), and cancel_request().
|
private |
Definition at line 45 of file request_queue_impl_qwqr.h.
Referenced by add_request(), cancel_request(), worker(), and ~request_queue_impl_qwqr().
|
private |
Definition at line 44 of file request_queue_impl_qwqr.h.
Referenced by request_queue_impl_qwqr(), and ~request_queue_impl_qwqr().
|
private |
Definition at line 43 of file request_queue_impl_qwqr.h.
Referenced by add_request(), cancel_request(), request_queue_impl_qwqr(), and ~request_queue_impl_qwqr().
|
private |
Definition at line 38 of file request_queue_impl_qwqr.h.
Referenced by add_request(), and cancel_request().
|
private |
Definition at line 40 of file request_queue_impl_qwqr.h.
Referenced by add_request(), and cancel_request().