STXXL  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
request_queue_impl_1q.h
Go to the documentation of this file.
1 /***************************************************************************
2  * include/stxxl/bits/io/request_queue_impl_1q.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  *
10  * Distributed under the Boost Software License, Version 1.0.
11  * (See accompanying file LICENSE_1_0.txt or copy at
12  * http://www.boost.org/LICENSE_1_0.txt)
13  **************************************************************************/
14 
15 #ifndef STXXL_IO_REQUEST_QUEUE_IMPL_1Q_HEADER
16 #define STXXL_IO_REQUEST_QUEUE_IMPL_1Q_HEADER
17 
18 #include <list>
19 
22 
23 
25 
26 //! \addtogroup iolayer
27 //! \{
28 
30 {
31 private:
32  typedef request_queue_impl_1q self;
33  typedef std::list<request_ptr> queue_type;
34 
37 
39  thread_type thread;
41 
42  static const priority_op _priority_op = WRITE;
43 
44  static void * worker(void* arg);
45 
46 public:
47  // \param n max number of requests simultaneously submitted to disk
48  request_queue_impl_1q(int n = 1);
49 
50  // in a multi-threaded setup this does not work as intended
51  // also there were race conditions possible
52  // and actually an old value was never restored once a new one was set ...
53  // so just disable it and all it's nice implications
55  {
56  //_priority_op = op;
57  STXXL_UNUSED(op);
58  }
59  void add_request(request_ptr& req);
60  bool cancel_request(request_ptr& req);
62 };
63 
64 //! \}
65 
67 
68 #endif // !STXXL_IO_REQUEST_QUEUE_IMPL_1Q_HEADER
69 // vim: et:ts=4:sw=4
void set_priority_op(priority_op op)
std::list< request_ptr > queue_type
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
void STXXL_UNUSED(const U &)
Definition: unused.h:23
state< thread_state > m_thread_state
#define STXXL_END_NAMESPACE
Definition: namespace.h:17