From 71bbe79abd190bb9301579567682b71aa7b3228d Mon Sep 17 00:00:00 2001 From: Levi Tamasi Date: Wed, 1 Sep 2021 16:35:51 -0700 Subject: [PATCH] Fix an invalid UTF-8 character in WINDOWS_PORT.md Reviewed By: ajkr, riversand963 Differential Revision: D30713977 fbshipit-source-id: b46a9a860d32e8fa0cb2b980b9b33d5148f9715f --- WINDOWS_PORT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WINDOWS_PORT.md b/WINDOWS_PORT.md index 57293c97c..176a36c10 100644 --- a/WINDOWS_PORT.md +++ b/WINDOWS_PORT.md @@ -66,7 +66,7 @@ We endeavored to make it functionally on par with posix_env. This means we repli Even though Windows provides its own efficient thread-pool implementation we chose to replicate posix logic using `std::thread` primitives. This allows anyone to quickly detect any changes within the posix source code and replicate them within windows env. This has proven to work very well. At the same time for anyone who wishes to replace the built-in thread-pool can do so using RocksDB stackable environments. For disk access we implemented all of the functionality present within the posix_env which includes memory mapped files, random access, rate-limiter support etc. -The `use_os_buffer` flag on Posix platforms currently denotes disabling read-ahead log via `fadvise` mechanism. Windows does not have `fadvise` system call. What is more, it implements disk cache in a way that differs from Linux greatly. It’s not an uncommon practice on Windows to perform un-buffered disk access to gain control of the memory consumption. We think that in our use case this may also be a good configuration option at the expense of disk throughput. To compensate one may increase the configured in-memory cache size instead. Thus we have chosen `use_os_buffer=false` to disable OS disk buffering for `WinWritableFile` and `WinRandomAccessFile`. The OS imposes restrictions on the alignment of the disk offsets, buffers used and the amount of data that is read/written when accessing files in un-buffered mode. When the option is true, the classes behave in a standard way. This allows to perform writes and reads in cases when un-buffered access does not make sense such as WAL and MANIFEST. +The `use_os_buffer` flag on Posix platforms currently denotes disabling read-ahead log via `fadvise` mechanism. Windows does not have `fadvise` system call. What is more, it implements disk cache in a way that differs from Linux greatly. It's not an uncommon practice on Windows to perform un-buffered disk access to gain control of the memory consumption. We think that in our use case this may also be a good configuration option at the expense of disk throughput. To compensate one may increase the configured in-memory cache size instead. Thus we have chosen `use_os_buffer=false` to disable OS disk buffering for `WinWritableFile` and `WinRandomAccessFile`. The OS imposes restrictions on the alignment of the disk offsets, buffers used and the amount of data that is read/written when accessing files in un-buffered mode. When the option is true, the classes behave in a standard way. This allows to perform writes and reads in cases when un-buffered access does not make sense such as WAL and MANIFEST. We have replaced `pread/pwrite` with `WriteFile/ReadFile` with `OVERLAPPED` structure so we can atomically seek to the position of the disk operation but still perform the operation synchronously. Thus we able to emulate that functionality of `pread/pwrite` reasonably well. The only difference is that the file pointer is not returned to its original position but that hardly matters given the random nature of access.