function lfds700_queue_bss_enqueue

From liblfds.org
Revision as of 02:00, 30 December 2015 by Admin (talk | contribs) (→‎Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source Files

└───liblfds700
    ├───inc
    │   └───liblfds700
    │           lfds700_queue_bounded_singleconsumer_singleproducer.h
    └───src
        └───lfds700_queue_bounded_singleconsumer_singleproducer
                lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c

Opaque Structures

struct lfds700_queue_bss_state;

Prototype

void lfds700_queue_bss_enqueue( struct lfds700_queue_bss_state *qbsss, void *key, void *value );

Parameters

struct lfds700_queue_bss_state *qbsss

A pointer to an initialized struct lfds700_queue_bss_state.

void *key

A void pointer of user data which will be queued into the queue as the key.

void *value

A void pointer of user data which will be queued into the queue as the value.

Return Value

Returns 1 on a successful enqueue. Returns 0 if enqueing failed. Enqueuing only fails if the queue is full.

Notes

This function takes a user-provided void pointer (which typically points to user allocated store, but could of course be used directly) and enqueues it into the queue.

Unlike all the other data structures in liblfds, there is with this queue no guarantee that enqueued elements are ever seen by the consumer thread. In practise, they are, and in a very short time - fifty microseconds or whatever it may be; but, unlike the other data structures, there is then on guarantee of visibility simply because the enqueue function has returned.

Example

Coming soon. No, really! (Written 29th Dec 2015).

See Also