Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
Synchronization
 Interlocked Singly Linked Lists
Interlocked Singly Linked Lists

An interlocked singly linked list (SList) eases the task of insertion and deletion from a linked list. SLists are implemented using a nonblocking algorithm to provide atomic synchronization, increase system performance, and avoid problems such as priority inversion and lock convoys.

SLists are straightforward to implement and use in 32-bit code. However, it is challenging to implement them in 64-bit code because the amount of data exchangeable by the native interlocked exchange primitives is not double the address size, as it is in 32-bit code. Therefore, SLists enable porting high-end scalable algorithms to Windows.

Applications can use SLists by calling the InitializeSListHead function to initialize the head of the list. To insert items into the list, use the InterlockedPushEntrySList function. To delete items from the list, use the InterlockedPopEntrySList function.

For an example, see Using Singly Linked Lists.

The following table lists the SList functions.

FunctionDescription
InitializeSListHeadInitializes the head of a singly linked list.
InterlockedFlushSListFlushes the entire list of items in a singly linked list.
InterlockedPopEntrySListRemoves an item from the front of a singly linked list.
InterlockedPushEntrySListInserts an item at the front of a singly linked list.
QueryDepthSListRetrieves the number of entries in the specified singly linked list.

Send comments about this topic to Microsoft

Build date: 11/6/2008

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker