On Jul 25, 2016, at 9:37 PM, Daniel Stenmark wrote:
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
> 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 unlo
> On Jul 25, 2016, at 12:37 PM, Daniel Stenmark wrote:
>
> 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?
To get multithreaded access to the file contents. This is pretty common when
using da
> On 26 Jul 2016, at 5:37 AM, Daniel Stenmark wrote:
>
> 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 co
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
Hello list,
I find Apple’s documentation on this unclear. It says:
"NSFileHandle, NSData, Cocoa streams:
Most of the Foundation objects you use to read and write file data can be used
from any single thread but should not be used from multiple threads
simultaneously."
For example I would like