3 ms·
Just a webserver. If two threads write to a file at the same time, you start getting wonky issues. You know, like if you and I make a comment at the same time
by dragontamer 4y ago
Just a webserver. If two threads write to a file at the same time, you start getting wonky issues.
You know, like if you and I make a comment at the same time here on Hacker News, the server's hard drive has to serialize the data so that all the other readers can handle it.
- dcow 4y agoI was thinking more about what mmap has to do with anything. Anyway it depends on the API you use. libc read/write are thread safe for instance. Obviously you still have to synchronize the higher level concept of writes if you are not writing an object all at once, but this is rather trivial to do.