Re: Interlocked Singly Linked Lists (for Ben or anyone else).
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Wed, 14 Nov 2007 08:26:51 -0600
"Pops" <dude@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23tndYNsJIHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
Ben (C++ MVP) recommended using the Interlocked Singly Linked Lists API:
http://msdn2.microsoft.com/en-us/library/ms686962.aspx
as a more efficient synchronization method for a recent thread discussion
in regards to a FIFO queue design.
If Ben is reading or if anyone else is familiar with this API, I have a
few questions:
First, based on what I see, this is for LIFO designs (i.e., stacks)? Not
FIFO. Am I missing something? I only see Push/Pop functions, no
head/tail functions.
We were discussing a multiple writer, single consumer queue. For this the
writers each use the InterlockedPushEntrySList function, while the consumer
uses the InterlockedFlushSList function to retrieve the entire queue as an
atomic operation. The consumer is then responsible for iterating through
the list of items retrieved in FIFO order.
Seconds, can you tell how it works with IPC, can it work for IPC?
Because there is no name assigned, the SList cannot establish an IPC
channel. However, because the caller has control over the placement of all
data structures involved, it should be possible to use with shared memory.
It would be highly desirable in such cases to obtain the same virtual
address space in each of the processes. If this is not possible, then you
probably can't use the Win32 API implementation, though the underlying
algorithm will still work (using relative addresses / indices instead of
pointers).
Thanks
--
HLS
.
- Follow-Ups:
- Re: Interlocked Singly Linked Lists (for Ben or anyone else).
- From: Pops
- Re: Interlocked Singly Linked Lists (for Ben or anyone else).
- From: Pops
- Re: Interlocked Singly Linked Lists (for Ben or anyone else).
- From: Chris Thomasson
- Re: Interlocked Singly Linked Lists (for Ben or anyone else).
- From: Pops
- Re: Interlocked Singly Linked Lists (for Ben or anyone else).
- References:
- Prev by Date: Interlocked Singly Linked Lists (for Ben or anyone else).
- Next by Date: Re: Interlocked Singly Linked Lists (for Ben or anyone else).
- Previous by thread: Interlocked Singly Linked Lists (for Ben or anyone else).
- Next by thread: Re: Interlocked Singly Linked Lists (for Ben or anyone else).
- Index(es):
Relevant Pages
|
Loading