Table of Contents

Name

future_join_all - join with some number of futures

Synopsis

#include <qthread/futurelib.h>

void
future_join_all (aligned_t *fta, int ftc);

Description

This is a function which blocks until each one of an array of futures terminates.

The first argument is a pointer to the qthread executing the join. The second argument, fta, is an array of the return locations of the futures the calling thread will join. The final argument, ftc, indicates the number of futures in the array.

When a thread attempts to join with future computations, the action may block, as futures are waiting for the number of active threads to drop. Deadlock may result if threads are holding resources while attempting to join to futures which are waiting for resources. Therefore, when a thread attempts to join, it must explicitly declare itself inactive using the future_yield() function, then reactivate itself using the future_acquire() function.

The typical sequence for creating futures is:

1) yield
2) loop creating futures
3) [optional: join with futures]
4) acquire

See Also

future_join_all(3) , future_init(3) , future_exit(3) , future_yield(3) , future_acquire(3)


Table of Contents