5 Eylül 2018 Çarşamba

open metodu

O_DIRECT seçeneği
Açıklaması şöyle.
Then there's also the O_DIRECT flag to open(), which is supposed to "try to minimize cache effects of the I/O to and from this file." Removing caching reduces performance, so that's mostly used by applications (databases) that do their own caching and want to be in control of it. (O_DIRECT isn't without its issues, the comments about it in the man page are somewhat amusing.)
- O_DIRECT seçeneği ile Page Cache (yani Virtual Memory gibi düşünülebilir) kullanılmıyor ancak Disk Write Cache halen kullanılıyor. Burada O_DIRECT açıklanmış.

- O_DIRECT'e karşılık olarak Windows'ta FILE_FLAG_NO_BUFFERING (önbellekte tutma) seçeneği kullanılabilir.

- Bir dosyanın O_DIRECT seçeneği ile açılıp açılmadığını görmek için How to tell if a given process opened files with O_DIRECT? sorusunun cevabına göz atabilirsiniz. Bu bayrağın kullanılması diske yazma işleminde tüm verinin tamamen yazıldıktan sonra write() metodunun dönmesini garanti etmez! How are the O_SYNC and O_DIRECT flags in open(2) different/alike? sorusunda da bu durum açıklanıyor.

Hiç yorum yok:

Yorum Gönder