Table of Contents


qthread_readFE - waits for the source to be full, then copies and empties it


#include <qthread.h>

qthread_readFE (aligned_t *dest, const aligned_t *src);


This function waits for memory to become full, and then empties it. When memory becomes full, only one thread blocked like this will be awoken. Data is read from src and stored in dest.

The semantics of readFE are:

1 - src’s FEB state must be "full"
2 - data is copied from src to dest
3 - src’s FEB state gets changed from "full" to "empty"


This, and all other FEB-related functions currently operate exclusively on aligned data. This is to simulate the behavior of the XMT as closely as possible. The library requires 4- or 8-byte alignment, depending on whether compiled in 32-bit or 64-bit mode.

Return Value

On success, the memory address src is marked empty, the memory address dest is filled with the contents of src and 0 is returned. On error, a non-zero error code is returned.


Not enough memory could be allocated for bookkeeping structures.

See Also

qthread_empty(3) , qthread_fill(3) , qthread_writeEF(3) , qthread_writeF(3) , qthread_readFF(3) , qthread_lock(3) , qthread_unlock(3)

Table of Contents