Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch > #31485

Re: Efficient lock free FIFO

From nmm@wheeler.UUCP (Nick Maclaren)
Newsgroups comp.arch
Subject Re: Efficient lock free FIFO
Date 2015-12-06 12:43 +0000
Organization Old Fogies Society
Message-ID <n41ah9$hvt$1@dont-email.me> (permalink)
References <ec9545f0-93a8-4672-8f59-695eee864d30@googlegroups.com> <n3rprp$37u$1@dont-email.me> <n404j4$odt$1@speranza.aioe.org> <9f7955f4-9b51-43fc-a23f-0ef1fa47f944@googlegroups.com>

Show all headers | View raw


In article <9f7955f4-9b51-43fc-a23f-0ef1fa47f944@googlegroups.com>,
 <already5chosen@yahoo.com> wrote:
>On Sunday, December 6, 2015 at 3:55:55 AM UTC+2, Chris M. Thomasson wrote:
>> 
>> > It's useful, and has been used since time immemorial. The main use
>> > of such techniques is with interrupt handling, where the key factor
>> > is to be able to detect an interrupted update and fix it up without
>> > causing other problems.
>> 
>> Indeed they are extremely useful for such conditions.
>>
>Can you elaborate?
>
>To explain myself, I have no doubt that FIFOs implemented as
>single-linked-list are useful. But I have serious doubt that lockless
>implementation of such FIFO is useful in the context that you and Nick
>presented.

The scenario is this.  A program needs to update and use some sort of
data structure, but can be interrupted asynchronously.  Very common.
The run-time system then needs to trap the interrupt, clean up the
data structure enough that it can be used, and transfer control to
the code that will continue the execution.

All that is needed is a reliable way to detect that a data structure
was interrupted during an update, and a reliable way of cancelling or
completing the update.  The fixup code is not in the fast path, but
the ordinary updates assuredly are, so that lock-free methods are
almost essential.

A variant of this is an asynchronous interrupt while a lock or
unlock operation is in progress.  Any lock mechanism that doesn't
support that is inadequate for any system where asynchronous
interrupts are possible.

FIFOs are not special, but they are one of the most common forms of
data structure needed in real code.


Regards,
Nick Maclaren.

Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-03 18:56 -0800
  Re: Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-03 19:22 -0800
  Re: Efficient lock free FIFO Ivan Godard <ivan@millcomputing.com> - 2015-12-03 19:32 -0800
    Re: Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-03 19:36 -0800
      Re: Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-03 19:40 -0800
  Re: Efficient lock free FIFO "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-12-03 21:46 -0800
    Re: Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-04 00:12 -0800
      Re: Efficient lock free FIFO "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-12-04 13:59 -0800
        Re: Efficient lock free FIFO "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-12-04 14:06 -0800
        Re: Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-04 15:36 -0800
          Re: Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-04 15:40 -0800
        Re: Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-04 15:53 -0800
          Re: Efficient lock free FIFO "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-12-05 13:36 -0800
            Re: Efficient lock free FIFO "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-12-05 13:39 -0800
  Re: Efficient lock free FIFO already5chosen@yahoo.com - 2015-12-04 01:59 -0800
    Re: Efficient lock free FIFO nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-04 10:28 +0000
      Re: Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-04 07:08 -0800
      Re: Efficient lock free FIFO "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-12-05 17:55 -0800
        Re: Efficient lock free FIFO "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-12-05 17:59 -0800
        Re: Efficient lock free FIFO already5chosen@yahoo.com - 2015-12-06 04:03 -0800
          Re: Efficient lock free FIFO nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-06 12:43 +0000
    Re: Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-04 06:56 -0800
      Re: Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-04 07:04 -0800
      Re: Efficient lock free FIFO already5chosen@yahoo.com - 2015-12-05 08:56 -0800
        Re: Efficient lock free FIFO "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-12-05 13:43 -0800
          Re: Efficient lock free FIFO "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-12-05 13:51 -0800
  Re: Efficient lock free FIFO (Something ...?) jacko <jackokring@gmail.com> - 2015-12-06 07:08 -0800
  Re: Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-06 11:58 -0800
    Re: Efficient lock free FIFO "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-12-06 13:02 -0800
      Re: Efficient lock free FIFO jacko <jackokring@gmail.com> - 2015-12-06 13:37 -0800

csiph-web