Table of Contents

Name

qthread_syncvar_writeF, qthread_syncvar_writeF_const - fills a syncvar_t with data

Synopsis

#include <qthread.h>

int
qthread_syncvar_writeF (syncvar_t * restrict dest, const uint64_t * restrict src);

int
qthread_syncvar_writeF_const (syncvar_t *dest, uint64_t src);

Description

These functions are a cross between qthread_syncvar_fill() and qthread_syncvar_writeEF(). They do not wait for memory to become empty, but perform the write and set the state to full atomically (with respect to other syncvar_t actions). Data is read from src and written to dest.

The semantics of writeF are:

1 - data is copied from src to dest
2 - dest’s FEB state gets set to "full"

Return Value

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

Errors

ENOMEM
Not enough memory could be allocated for bookkeeping structures.
EOVERFLOW
The value specified in src could not be stored in the syncvar_t. On most platforms, syncvar_t can only store 60 bits of data, despite occupying 64 bits of memory, because four bits are reserved for status information. QTHREAD_TIMEOUT Could not obtain the lock on the syncvar_t’s status bits. This may be caused by many things, including memory corruption, invalid syncvar, or even absurdly excessive contention (because its protected by a naive spinlock rather than a fair spinlock).

See Also

qthread_syncvar_empty(3) , qthread_syncvar_fill(3) , qthread_syncvar_writeFE(3) , qthread_syncvar_readFF(3) , qthread_syncvar_readFE(3) , qthread_syncvar_status(3)


Table of Contents