Re: NSFileHandle and thread safety
Re: NSFileHandle and thread safety
- Subject: Re: NSFileHandle and thread safety
- From: Daniel Stenmark <email@hidden>
- Date: Mon, 25 Jul 2016 19:37:54 +0000
- Thread-topic: NSFileHandle and thread safety
1. Can I write to two different files using two NSFIleHandles from two threads at the same time?
Yes.
2. Can I read from a single file using two NSFileHandles on two threads at the same time?
Why would you need to do that in the first place? Unless you’re reading a single byte at a time, it sounds like a sure-fire way to get corrupted data, regardless of whether you’re using NSFileHandle or good old POSIX methods. I don’t think there’s inherently dangerous about the operation itself, but the resulting data buffers are probably going to be gibberish.
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