• 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: NSFileHandle and thread safety
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFileHandle and thread safety


  • Subject: Re: NSFileHandle and thread safety
  • From: Daniel Stenmark <email@hidden>
  • Date: Tue, 26 Jul 2016 00:37:12 +0000
  • Thread-topic: NSFileHandle and thread safety

> As long as each thread has a separate file handle, they’re independent of each other, since each file handle remembers its own offset in the file.

Ah, durr, you’re right.  Apologies, I once had the displeasure of debugging an ancient codebase that used the same Unix file descriptor with unlocked reads and writes across at least half a dozen threads.  The original query brought some memories I had long suppressed.

J.E., please disregard my original answer.  Jens is right, two independent file handles reading from the same file on their own threads should be A-okay!

Dan

_______________________________________________

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: 
 >NSFileHandle and thread safety (From: "J.E. Schotsman" <email@hidden>)
 >Re: NSFileHandle and thread safety (From: Daniel Stenmark <email@hidden>)
 >Re: NSFileHandle and thread safety (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: NSFileHandle and thread safety
  • Next by Date: Re: awakeFromFetch behaviour change in 10.12?
  • Previous by thread: Re: NSFileHandle and thread safety
  • Next by thread: Re: NSFileHandle and thread safety
  • Index(es):
    • Date
    • Thread