sds_lqueue - Online Linux Manual PageSection : 3
Updated : Fri Feb 26 2021
Source : Version 2.0.3
Note : dirsrv

NAMEsds_lqueue − SDS Lock Free Queue

SYNOPSIS

Typedefstypedef struct _sds_tqueue sds_lqueue

Functionssds_result sds_lqueue_init (sds_lqueue **q_ptr, void(*value_free_fn)(void *value))
sds_result sds_lqueue_tprep (sds_lqueue *q)
sds_result sds_lqueue_enqueue (sds_lqueue *q, void *elem)
sds_result sds_lqueue_dequeue (sds_lqueue *q, void **elem)
sds_result sds_lqueue_destroy (sds_lqueue *q)

Detailed DescriptionThread safe lock free queue​. Falls back to platform mutex if cpu intrinsics are not present​.

Typedef Documentation

typedef struct _sds_tqueue sds_lqueueType definition of lock free queue to the mutex queue in the case that cpu intrinsics are not available, or the operating system is unsupported​.

Function Documentation

sds_result sds_lqueue_dequeue (sds_lqueue * q, void ** elem)Dequeue an item from the head of the queue​. Equivalent to 'pop'​. The safety of this operation is implicit, you do not need any other mutexes to protect this operation​. Parameters q The struct pointer to the queue you wish to pop from​.
elem a pointer to a location which will be over-ridden with the data that is dequeued​. This may be NULLed, even during an error​.
Return values sds_result to indicate the status of the operation​.

sds_result sds_lqueue_destroy (sds_lqueue * q)Indicate you are complete with the queue​. Free and delete any remaining internal structures, and free and still queued nodes​. You must always call this function to dispose of this structure​. Important to note, is that all thread consumers of this queue must be stopped before you call lqueue destroy​. This is your responsibility to ensure this​. Parameters q The struct pointer to the queue you wish to dispose of​. Return values sds_result to indicate the status of the operation​.

sds_result sds_lqueue_enqueue (sds_lqueue * q, void * elem)Enqueue an item to the tail of this queue​. Equivalent to 'push'​. The safety of this operation is implicit, you do not need any other mutexes to protect this operation​. Parameters q The struct pointer to the queue you wish to push to​.
elem The data to enqueue​.
Return values sds_result to indicate the status of the operation​.

sds_result sds_lqueue_init (sds_lqueue ** q_ptr, void(*)(void *value) value_free_fn)Initialise a queue suitable for access across multiple threads​. Free function must be set​. This utilises hardware intrinsics to provide atomicity that may be faster in highly contended applications​. Use this structure in place of a tqueue only if you know that content of the queue will be high​. Parameters q_ptr A pointer to the struct pointer you wish to allocate​. This may be on the heap or stack​.
value_free_fn A function pointer to free values that are enqueued to this structure​.
Return values sds_result to indicate the status of the operation​.

sds_result sds_lqueue_tprep (sds_lqueue * q)Initialise this thread ready to use the lqueue​. This is critical, and accessing the queue without calling tprep may result in undefined behaviour​.

AuthorGenerated automatically by Doxygen for dirsrv from the source code​.
0
Johanes Gumabo
Data Size   :   15,827 byte
man-sds_lqueue.3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 184,279
Visitor ID   :     :  
Visitor IP   :   3.17.181.112   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.