• 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: Multithreaded file read
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multithreaded file read


  • Subject: Re: Multithreaded file read
  • From: "Roger Herikstad" <email@hidden>
  • Date: Thu, 31 Jul 2008 22:05:59 +0800

Hi,
 Thanks to both you for your help. I see my concern was unnecessary,
as I am indeed using separate file descriptors for the threads.
Thanks!

~ Roger

On Thu, Jul 31, 2008 at 1:47 PM, Jens Alfke <email@hidden> wrote:
>
> On 29 Jul '08, at 11:06 PM, Roger Herikstad wrote:
>
> I have a cocoa program that will read these index files and
> fetch the appropriate data from the big file, plot it and store as an
> image. I would like to run these print operations in parallel, but I'm
> concerned that a conflict will arise if two threads are reading into
> the same file.
>
> As long as each thread opens its own file descriptor, you'll be fine. Each
> descriptor has its own cursor. The thing you shouldn't do is share a
> single file descriptor between threads (unless you use the pread/pwrite API,
> which is stateless.)
> —Jens
_______________________________________________

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

References: 
 >Multithreaded file read (From: "Roger Herikstad" <email@hidden>)
 >Re: Multithreaded file read (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: OT: Disk Utility creating corrupt DMGs for some
  • Next by Date: Re: Distributed Objects "connection went invalid while waiting for a reply"
  • Previous by thread: Re: Multithreaded file read
  • Next by thread: Two different actions depending on the event when clicking a NSStatusItem?
  • Index(es):
    • Date
    • Thread