Write to different sections of a file from multiple threads

Viewed 25

In Ruby, if I open the file once and have multiple threads, each thread writes to a distinct range of the file. Do I still need any kind of lock to make this thread safe?

For example,

  • thread 1 - writes 0-99 bytes
  • thread 2 - writes 100-199 bytes
  • ...
0 Answers
Related