15 #ifndef STXXL_IO_REQUEST_OPERATIONS_HEADER
16 #define STXXL_IO_REQUEST_OPERATIONS_HEADER
35 template <
class request_iterator_>
36 void wait_all(request_iterator_ reqs_begin, request_iterator_ reqs_end)
38 for ( ; reqs_begin != reqs_end; ++reqs_begin)
47 wait_all(req_array, req_array + count);
58 template <
class request_iterator_>
59 typename std::iterator_traits<request_iterator_>::difference_type
cancel_all(request_iterator_ reqs_begin, request_iterator_ reqs_end)
61 typename std::iterator_traits<request_iterator_>::difference_type num_canceled = 0;
62 while (reqs_begin != reqs_end)
75 template <
class request_iterator_>
76 request_iterator_
poll_any(request_iterator_ reqs_begin, request_iterator_ reqs_end)
78 while (reqs_begin != reqs_end)
97 index = res - req_array;
98 return res != (req_array +
count);
106 template <
class request_iterator_>
107 request_iterator_
wait_any(request_iterator_ reqs_begin, request_iterator_ reqs_end)
113 request_iterator_ cur = reqs_begin, result = reqs_end;
115 for ( ; cur != reqs_end; cur++)
122 if (cur != reqs_begin)
124 while (--cur != reqs_begin)
138 for (cur = reqs_begin; cur != reqs_end; cur++)
141 if (result == reqs_end && (
request_ptr(*cur))->poll())
155 return wait_any(req_array, req_array + count) - req_array;
162 #endif // !STXXL_IO_REQUEST_OPERATIONS_HEADER
std::iterator_traits< request_iterator_ >::difference_type cancel_all(request_iterator_ reqs_begin, request_iterator_ 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.
counting_ptr< request > request_ptr
A reference counting pointer for request.
void wait_all(request_iterator_ reqs_begin, request_iterator_ reqs_end)
Collection of functions to track statuses of a number of requests.
static void count(type_key *a, type_key *aEnd, int_type *bucket, int_type K, typename type_key::key_type offset, unsigned shift)
#define STXXL_BEGIN_NAMESPACE
request_iterator_ wait_any(request_iterator_ reqs_begin, request_iterator_ reqs_end)
Suspends calling thread until any of requests is completed.
request_iterator_ poll_any(request_iterator_ reqs_begin, request_iterator_ reqs_end)
Polls requests.
void wait_for_on()
wait for switch to turn ON
#define STXXL_END_NAMESPACE