STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
I/O Requests and Queues

Encapsulation of an I/O request, queues for requests and threads to process them. More...

+ Collaboration diagram for I/O Requests and Queues:

Classes

class  stxxl::disk_queues
 Encapsulates disk queues. More...
 
class  stxxl::linuxaio_queue
 Queue for linuxaio_file(s) More...
 
class  stxxl::linuxaio_request
 Request for an linuxaio_file. More...
 
class  stxxl::request
 Request object encapsulating basic properties like file and offset. More...
 
class  stxxl::request_interface
 Functional interface of a request. More...
 
class  stxxl::request_queue
 Interface of a request_queue to which requests can be added and canceled. More...
 
class  stxxl::request_queue_impl_1q
 Implementation of a local request queue having only one queue for both read and write requests, thus having only one thread. More...
 
class  stxxl::request_queue_impl_qwqr
 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. More...
 
class  stxxl::request_queue_impl_worker
 Implementation of request queue worker threads. Worker threads can be started by start_thread and stopped with stop_thread. The queue state is checked before termination and updated afterwards. More...
 
class  stxxl::request_with_state
 Request with completion state. More...
 
class  stxxl::request_with_waiters
 Request that is aware of threads waiting for it to complete. More...
 
class  stxxl::serving_request
 Request which serves an I/O by calling the synchronous routine of the file. More...
 

Macros

#define STXXL_BLOCK_ALIGN   4096
 

Typedefs

typedef counting_ptr< request > stxxl::request_ptr
 A reference counting pointer for request. More...
 

Functions

template<class RequestIterator >
std::iterator_traits
< RequestIterator >
::difference_type 
stxxl::cancel_all (RequestIterator reqs_begin, RequestIterator reqs_end)
 Cancel requests. The specified requests are canceled unless already being processed. However, cancelation cannot be guaranteed. Cancelled requests must still be waited for in order to ensure correct operation. More...
 
std::ostream & stxxl::operator<< (std::ostream &out, const request &req)
 
template<class RequestIterator >
RequestIterator stxxl::poll_any (RequestIterator reqs_begin, RequestIterator reqs_end)
 Polls requests. More...
 
bool stxxl::poll_any (request_ptr req_array[], size_t count, size_t &index)
 Polls requests. More...
 
template<class RequestIterator >
void stxxl::wait_all (RequestIterator reqs_begin, RequestIterator reqs_end)
 Collection of functions to track statuses of a number of requests. More...
 
void stxxl::wait_all (request_ptr req_array[], size_t count)
 Suspends calling thread until all given requests are completed. More...
 
template<class RequestIterator >
RequestIterator stxxl::wait_any (RequestIterator reqs_begin, RequestIterator reqs_end)
 Suspends calling thread until any of requests is completed. More...
 
size_t stxxl::wait_any (request_ptr req_array[], size_t count)
 Suspends calling thread until any of requests is completed. More...
 

Detailed Description

Encapsulation of an I/O request, queues for requests and threads to process them.

Macro Definition Documentation

Typedef Documentation

typedef counting_ptr<request> stxxl::request_ptr

A reference counting pointer for request.

Definition at line 113 of file request.h.

Function Documentation

template<class RequestIterator >
std::iterator_traits<RequestIterator>::difference_type stxxl::cancel_all ( RequestIterator  reqs_begin,
RequestIterator  reqs_end 
)

Cancel requests. The specified requests are canceled unless already being processed. However, cancelation cannot be guaranteed. Cancelled requests must still be waited for in order to ensure correct operation.

Parameters
reqs_beginbegin of request sequence
reqs_endend of request sequence
Returns
number of request canceled

Definition at line 58 of file request_operations.h.

std::ostream& stxxl::operator<< ( std::ostream &  out,
const request &  req 
)
inline

Definition at line 107 of file request.h.

References stxxl::request::print().

template<class RequestIterator >
RequestIterator stxxl::poll_any ( RequestIterator  reqs_begin,
RequestIterator  reqs_end 
)

Polls requests.

Parameters
reqs_beginbegin of request sequence to poll
reqs_endend of request sequence to poll
Returns
true if any of requests is completed, then index contains valid value, otherwise false

Definition at line 75 of file request_operations.h.

Referenced by stxxl::poll_any().

bool stxxl::poll_any ( request_ptr  req_array[],
size_t  count,
size_t &  index 
)
inline

Polls requests.

Parameters
req_arrayarray of request_ptr objects
countsize of req_array
indexcontains index of the first completed request if any
Returns
true if any of requests is completed, then index contains valid value, otherwise false

Definition at line 92 of file request_operations.h.

References stxxl::count(), and stxxl::poll_any().

template<class RequestIterator >
void stxxl::wait_all ( RequestIterator  reqs_begin,
RequestIterator  reqs_end 
)
void stxxl::wait_all ( request_ptr  req_array[],
size_t  count 
)
inline

Suspends calling thread until all given requests are completed.

Parameters
req_arrayarray of request_ptr objects
countsize of req_array

Definition at line 43 of file request_operations.h.

References stxxl::wait_all().

template<class RequestIterator >
RequestIterator stxxl::wait_any ( RequestIterator  reqs_begin,
RequestIterator  reqs_end 
)

Suspends calling thread until any of requests is completed.

Parameters
reqs_beginbegin of request sequence to wait for
reqs_endend of request sequence to wait for
Returns
index in req_array pointing to the first completed request

Definition at line 104 of file request_operations.h.

References stxxl::onoff_switch::wait_for_on().

Referenced by stxxl::buffered_writer< block_type >::get_free_block(), stxxl::write_pool< BlockType >::steal(), and stxxl::wait_any().

size_t stxxl::wait_any ( request_ptr  req_array[],
size_t  count 
)
inline

Suspends calling thread until any of requests is completed.

Parameters
req_arrayarray of request_ptr objects
countsize of req_array
Returns
index in req_array pointing to the first completed request

Definition at line 149 of file request_operations.h.

References stxxl::wait_any().