Yes... They are capable of virtual concurrency. But you shouldn't allow concurrent access for writes. You should allow two threads to concurrently read, and make the file interface class synchronize and block for the file pointer. And you should block concurrent writes, since you cannot predict the final state the data will be in. I probably didn't answer your question.
Ben, Could you please elaborate a bit on 'virtual concurrency' ? How can we block on a file pointer ? File pointer is not an object, it is part of the File object. But if we block on File object, only one thread can access a file(for reading or writing) which will really slow down the things. Thanks,
Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one:
Devious Experiments for a Truly Passive Greenhouse!