.\" Automatically generated by Pandoc 2.17.1.1 .\" .TH "RUNTIME_WAIT" "3" "2022-09-04" "MINIASYNC - miniasync version 0.2.1" "MINIASYNC Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2020-2022, Intel Corporation .SH NAME .PP \f[B]runtime_wait\f[R](), \f[B]runtime_wait_multiple\f[R]() - wait for the completion of single or multiple futures .SH SYNOPSIS .IP .nf \f[C] #include struct future { future_task_fn task; struct future_context context; }; struct runtime; void runtime_wait(struct runtime *runtime, struct future *fut); void runtime_wait_multiple(struct runtime *runtime, struct future *futs[], size_t nfuts); \f[R] .fi .PP For general description of runtime API, see \f[B]miniasync_runtime\f[R](7). .SH DESCRIPTION .PP The \f[B]runtime_wait\f[R]() function blocks the calling thread until the future structure pointed by \f[I]fut\f[R] completes. While waiting the calling thread repeatedly polls the future with \f[B]future_poll\f[R](3) function until completion. .PP The \f[B]runtime_wait_multiple\f[R]() function works similar to the \f[B]runtime_wait\f[R]() function, additionally it facilitates polling of multiple futures in an array. \f[B]runtime_wait_multiple\f[R]() function uniformly polls the first \f[I]nfuts\f[R] futures in the array pointed by \f[I]futs\f[R] until all of them complete execution. Runtime execution can be influenced by future properties. For more information about the future properties, see \f[B]miniasync_future\f[R](7). .PP Properties, which affect runtime: * \f[B]FUTURE_PROPERTY_ASYNC\f[R] property should be applied to asynchronous futures. During \f[B]runtime_wait_multiple\f[R]() function, asynchronous futures have a priority over the synchronous ones and, in general, are being polled first. .PP \f[B]miniasync\f[R](7) runtime implementation makes use of the waker notifier feature to optimize future polling. For more information about the waker feature, see \f[B]miniasync_future\f[R](7). .SS RETURN VALUE .PP The \f[B]runtime_wait\f[R]() function returns a pointer to a new runtime structure. .PP The \f[B]runtime_wait_multiple\f[R]() function does not return any value. .SH SEE ALSO .PP \f[B]future_poll\f[R](3), \f[B]miniasync\f[R](7), \f[B]miniasync_future\f[R](7) \f[B]miniasync_runtime\f[R](7) and \f[B]\f[R]