STXXL  1.4.0
 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 
24 
26 
27 //! \addtogroup iolayer
28 //! \{
29 
31 {
32 private:
34  typedef std::list<request_ptr> queue_type;
35 
40 
42  thread_type thread;
44 
45  static const priority_op _priority_op = WRITE;
46 
47  static void * worker(void* arg);
48 
49 public:
50  // \param n max number of requests simultaneously submitted to disk
51  request_queue_impl_qwqr(int n = 1);
52 
53  // in a multi-threaded setup this does not work as intended
54  // also there were race conditions possible
55  // and actually an old value was never restored once a new one was set ...
56  // so just disable it and all it's nice implications
58  {
59  //_priority_op = op;
60  STXXL_UNUSED(op);
61  }
62  void add_request(request_ptr& req);
63  bool cancel_request(request_ptr& req);
65 };
66 
67 //! \}
68 
70 
71 #endif // !STXXL_IO_REQUEST_QUEUE_IMPL_QWQR_HEADER
72 // vim: et:ts=4:sw=4
std::list< request_ptr > queue_type
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
void STXXL_UNUSED(const U &)
Definition: unused.h:23
#define STXXL_END_NAMESPACE
Definition: namespace.h:17