15 #ifndef STXXL_IO_REQUEST_OPERATIONS_HEADER
16 #define STXXL_IO_REQUEST_OPERATIONS_HEADER
33 template <
class RequestIterator>
34 void wait_all(RequestIterator reqs_begin, RequestIterator reqs_end)
36 for ( ; reqs_begin != reqs_end; ++reqs_begin)
45 wait_all(req_array, req_array + count);
56 template <
class RequestIterator>
57 typename std::iterator_traits<RequestIterator>::difference_type
58 cancel_all(RequestIterator reqs_begin, RequestIterator reqs_end)
60 typename std::iterator_traits<RequestIterator>::difference_type num_canceled = 0;
61 while (reqs_begin != reqs_end)
74 template <
class RequestIterator>
75 RequestIterator
poll_any(RequestIterator reqs_begin, RequestIterator reqs_end)
77 while (reqs_begin != reqs_end)
95 index = res - req_array;
96 return res != (req_array +
count);
103 template <
class RequestIterator>
104 RequestIterator
wait_any(RequestIterator reqs_begin, RequestIterator reqs_end)
110 RequestIterator cur = reqs_begin, result = reqs_end;
112 for ( ; cur != reqs_end; cur++)
119 if (cur != reqs_begin)
121 while (--cur != reqs_begin)
135 for (cur = reqs_begin; cur != reqs_end; cur++)
138 if (result == reqs_end && (
request_ptr(*cur))->poll())
151 return wait_any(req_array, req_array + count) - req_array;
158 #endif // !STXXL_IO_REQUEST_OPERATIONS_HEADER
High-performance smart pointer used as a wrapping reference counting pointer.
counting_ptr< request > request_ptr
A reference counting pointer for request.
RequestIterator poll_any(RequestIterator reqs_begin, RequestIterator reqs_end)
Polls requests.
std::iterator_traits< RequestIterator >::difference_type 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.
#define STXXL_BEGIN_NAMESPACE
static void count(TypeKey *a, TypeKey *aEnd, int_type *bucket, int_type K, typename TypeKey::key_type offset, unsigned shift)
void wait_all(RequestIterator reqs_begin, RequestIterator reqs_end)
Collection of functions to track statuses of a number of requests.
RequestIterator wait_any(RequestIterator reqs_begin, RequestIterator reqs_end)
Suspends calling thread until any of requests is completed.
void wait_for_on()
wait for switch to turn ON
#define STXXL_END_NAMESPACE