• 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: Task dispatching
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Task dispatching


  • Subject: Re: Task dispatching
  • From: Steve Sisak <email@hidden>
  • Date: Tue, 13 Sep 2011 17:28:54 -0400

At 2:39 PM -0600 9/13/11, Scott Ribe wrote:
\Note that your disk is not really providing 1.25GB/sec reads. What was probably happening is that the file contents were in system cache because of your prior reads. (Assuming that with the mmap code you were actually reading all the data...)

Actually, I believe that mmap just maps the the file into memory using the VM system -- it's initially paged out and read in as each page is touched.


This means you take the equivalent of a VM page miss the first time you touch a page but:

1) You also never read in pages that aren't touched (if your array is sparse)
2) Multiple process will share the same copy of the file in RAM
3) Page outs are "free" because the memory is backed by the file
4) Pages are read efficiently and don't pollute the FS cache

So, this is a very efficient way to handle a large data set.

BTW, if I were writing new code, I'd probably use NSOperation or dispatch queues and a single process.

Check out Quinn's QHTTPOperation sample code.

HTH,

-Steve
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Task dispatching
      • From: Scott Ribe <email@hidden>
References: 
 >Re: Task dispatching (From: Greg Guerin <email@hidden>)
 >Re: Task dispatching (From: Jon Sigman <email@hidden>)
 >Re: Task dispatching (From: Scott Ribe <email@hidden>)

  • Prev by Date: Template images in sidebars drawn in wrong color
  • Next by Date: What does CMDeviceMotion do if there is no gyro?
  • Previous by thread: Re: Task dispatching
  • Next by thread: Re: Task dispatching
  • Index(es):
    • Date
    • Thread