STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
request_queue_impl_qwqr.h
Go to the documentation of this file.
1 /***************************************************************************
2  * include/stxxl/bits/io/request_queue_impl_qwqr.h
3  *
4  * Part of the STXXL. See http://stxxl.sourceforge.net
5  *
6  * Copyright (C) 2002 Roman Dementiev <[email protected]>
7  * Copyright (C) 2008, 2009 Andreas Beckmann <[email protected]>
8  * Copyright (C) 2009 Johannes Singler <[email protected]>
9  * Copyright (C) 2013 Timo Bingmann <[email protected]>
10  *
11  * Distributed under the Boost Software License, Version 1.0.
12  * (See accompanying file LICENSE_1_0.txt or copy at
13  * http://www.boost.org/LICENSE_1_0.txt)
14  **************************************************************************/
15 
16 #ifndef STXXL_IO_REQUEST_QUEUE_IMPL_QWQR_HEADER
17 #define STXXL_IO_REQUEST_QUEUE_IMPL_QWQR_HEADER
18 
19 #include <list>
20 
23 
25 
26 //! \addtogroup reqlayer
27 //! \{
28 
29 //! Implementation of a local request queue having two queues, one for read and
30 //! one for write requests, thus having two threads. This is the default
31 //! implementation.
33 {
34 private:
36  typedef std::list<request_ptr> queue_type;
37 
42 
46 
47  static const priority_op m_priority_op = WRITE;
48 
49  static void * worker(void* arg);
50 
51 public:
52  // \param n max number of requests simultaneously submitted to disk
53  request_queue_impl_qwqr(int n = 1);
54 
55  // in a multi-threaded setup this does not work as intended
56  // also there were race conditions possible
57  // and actually an old value was never restored once a new one was set ...
58  // so just disable it and all it's nice implications
59  void set_priority_op(priority_op op)
60  {
61  //_priority_op = op;
62  STXXL_UNUSED(op);
63  }
64  void add_request(request_ptr& req);
65  bool cancel_request(request_ptr& req);
67 };
68 
69 //! \}
70 
72 
73 #endif // !STXXL_IO_REQUEST_QUEUE_IMPL_QWQR_HEADER
74 // vim: et:ts=4:sw=4
Implementation of a local request queue having two queues, one for read and one for write requests...
High-performance smart pointer used as a wrapping reference counting pointer.
Definition: counting_ptr.h:50
std::list< request_ptr > queue_type
Implementation of request queue worker threads. Worker threads can be started by start_thread and sto...
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
void STXXL_UNUSED(const U &)
Definition: unused.h:22
#define STXXL_END_NAMESPACE
Definition: namespace.h:17