• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: FIFOs.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FIFOs.


  • Subject: Re: FIFOs.
  • From: Peter Ammon <email@hidden>
  • Date: Tue, 11 Sep 2001 15:23:59 -0400

On Tuesday, September 11, 2001, at 12:14 AM, jgo wrote:

From: Ondra Cada <email@hidden>
To: "John C. Randolph" <email@hidden>
Date: Mon, 2001-08-20 16:00:39 +0200
John C. Randolph (JCR) wrote at Mon, 2001-08-20 06:45:10 -0700:
I want a FIFO implemented as a proper thread-safe ring buffer that will
grow as necessary to prevent overflow, and avoid needless shuffling of
memory as your example will do. I want this FIFO to be writeable by one
thread while being read by another.

The "memory shuffling" is a roaring nonsense.

Object "clutter" is roaring nonsense.

There just might be one application from 10000 which *MIGHT*
have such demands that NSMutableArray-based FIFO would be
unuseable there, but even that I doubt.

Ah, there you go, again, violating encapsulation by having the
framework/class using developer concerned with the implementation.

The problem with cobbling NSMutableArray is merely that
it is NOT a queue/FIFO, it is not a stack/LIFO; it's an array.

I seem to remember a discussion about this before, where it was revealed that NSArrays are actually implemented as circular buffers. The memory shuffling might be less than you think.

You can always download Darwin and check out the implementation of CFArray.

-Peter


  • Follow-Ups:
    • Re: FIFOs.
      • From: "Clark S. Cox III" <email@hidden>
References: 
 >Re: FIFOs. (From: jgo <email@hidden>)

  • Prev by Date: Re: Cocoa Open GL help
  • Next by Date: Re: Cocoa Open GL help
  • Previous by thread: Re: FIFOs.
  • Next by thread: Re: FIFOs.
  • Index(es):
    • Date
    • Thread