Re: NSFileHandle and thread safety
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