Re: Multiple File Open Strategy
Re: Multiple File Open Strategy
- Subject: Re: Multiple File Open Strategy
- From: Charles Srstka <email@hidden>
- Date: Wed, 29 Dec 2010 04:52:34 -0600
On Dec 22, 2010, at 3:25 PM, Jeremy Torres wrote:
> I have a working implementation using Grand Central dispatch queues that open a file and compute an OpenSSL DSA hash, writing out the hash to a new "side car" file for later verification.
>
> I would like to open multiple files at the same time, but based on some logic that doesn't "choke" the OS by having 100s of files open and exceeding the hard drive's sustainable output. Photo browsing applications such as iPhoto or Aperture seem to open multiple files and display them, so I'm assuming this can be done.
>
> Any suggestions?
NSOperationQueue has a -setMaxConcurrentOperationCount: method, so if you use it instead of GCD directly (NSOperationQueue still uses GCD under the hood), you can easily limit the number of operations that will run at once.
Charles_______________________________________________
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