Monday, May 24, 2010

Is fwrite in C blocking call?

Is fwrite in C blocking call from the app point of view? For example, if NFS is used as i/o, will the fwrite to a file residing on NFS mounted to the Linux be blocking?

Is fwrite in C blocking call?
yes, fwrite() is a blocking call - your program will not return from it while it is being processed.





Non-blocking calls only exist in programming environments with native threads, such as Windows. They do not really exist in UNIX. On Unix, non-blocking I/O within the same process is achieved using other tricks, such as select ( http://www.scit.wlv.ac.uk/cgi-bin/mansec... ).





Non-blocking equivalent of fwrite() on Windows is WriteFileEx():


http://msdn2.microsoft.com/en-us/library...


No comments:

Post a Comment