multithreading - non blocking thread-safe file write -


i trying write in file @ different offset locations using threads shouldn't blocked. not sure how proceed same. guessing need open file o_nonblock flag.

is need open file o_nonblock flag , writing process same ?

any sample piece of code helpful explanation

thanks

on unix/linux file descriptors associated files ready read , write. in other words, o_nonblock has no effect on regular files.

normally, writing file copies data kernel page cache , returns. unless file opened o_direct flag, or kernel page cache has many dirty pages in case write becomes blocking.

if need non-blocking writes file either create dedicated thread writing, or use asynchronous i/o.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -