/usr/include/stxxl/bits/io
NameSizeModeActions
boostfd_file.h21210644editdlrm
completion_handler.h28340644editdlrm
create_file.h13310644editdlrm
disk_queued_file.h17460644editdlrm
disk_queues.h39620644editdlrm
file.h76760644editdlrm
fileperblock_file.h25380644editdlrm
io.h12710644editdlrm
iostats.h162380644editdlrm
linuxaio_file.h25740644editdlrm
linuxaio_queue.h31090644editdlrm
linuxaio_request.h20990644editdlrm
mem_file.h17440644editdlrm
mmap_file.h18700644editdlrm
request.h31450644editdlrm
request_interface.h26820644editdlrm
request_operations.h51880644editdlrm
request_queue.h12450644editdlrm
request_queue_impl_1q.h21030644editdlrm
request_queue_impl_qwqr.h22740644editdlrm
request_queue_impl_worker.h20290644editdlrm
request_with_state.h16990644editdlrm
request_with_waiters.h15760644editdlrm
serving_request.h13870644editdlrm
simdisk_file.h42830644editdlrm
syscall_file.h18440644editdlrm
ufs_file_base.h18650644editdlrm
wbtl_file.h34150644editdlrm
wfs_file_base.h16630644editdlrm
wincall_file.h20450644editdlrm
Edit: /usr/include/stxxl/bits/io/linuxaio_queue.h (3109B)
/*************************************************************************** * include/stxxl/bits/io/linuxaio_queue.h * * Part of the STXXL. See http://stxxl.sourceforge.net * * Copyright (C) 2011 Johannes Singler * Copyright (C) 2014 Timo Bingmann * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) **************************************************************************/ #ifndef STXXL_IO_LINUXAIO_QUEUE_HEADER #define STXXL_IO_LINUXAIO_QUEUE_HEADER #include #if STXXL_HAVE_LINUXAIO_FILE #include #include #include #include STXXL_BEGIN_NAMESPACE //! \addtogroup reqlayer //! \{ //! Queue for linuxaio_file(s) //! //! Only one queue exists in a program, i.e. it is a singleton. class linuxaio_queue : public request_queue_impl_worker { friend class linuxaio_request; typedef linuxaio_queue self_type; private: //! OS context aio_context_t context; //! storing linuxaio_request* would drop ownership typedef std::list queue_type; // "waiting" request have submitted to this queue, but not yet to the OS, // those are "posted" mutex waiting_mtx, posted_mtx; queue_type waiting_requests, posted_requests; //! max number of OS requests int max_events; //! number of requests in waitings_requests semaphore num_waiting_requests, num_free_events, num_posted_requests; // two threads, one for posting, one for waiting thread_type post_thread, wait_thread; state post_thread_state, wait_thread_state; // Why do we need two threads, one for posting, and one for waiting? Is // one not enough? // 1. User call cannot io_submit directly, since this tends to take // considerable time sometimes // 2. A single thread cannot wait for the user program to post requests // and the OS to produce I/O completion events at the same time // (IOCB_CMD_NOOP does not seem to help here either) static const priority_op _priority_op = WRITE; static void * post_async(void* arg); // thread start callback static void * wait_async(void* arg); // thread start callback void post_requests(); void handle_events(io_event* events, long num_events, bool canceled); void wait_requests(); void suspend(); // needed by linuxaio_request aio_context_t get_io_context() { return context; } public: //! Construct queue. Requests max number of requests simultaneously //! submitted to disk, 0 means as many as possible linuxaio_queue(int desired_queue_length = 0); void add_request(request_ptr& req); bool cancel_request(request_ptr& req); void complete_request(request_ptr& req); ~linuxaio_queue(); }; //! \} STXXL_END_NAMESPACE #endif // #if STXXL_HAVE_LINUXAIO_FILE #endif // !STXXL_IO_LINUXAIO_QUEUE_HEADER // vim: et:ts=4:sw=4