For readers. Enable the process synchronization between the writer process. Once enabled, update_reader
checks the header for the process sync instead of the disk sync, and they do not need to wait a call of flush
in the writer.
A reader process obtains the latest state of the storage calling update_reader
function. By default, it can detect the updates only after the writer calls flush
. flush
synchronizes the disk and therefore is a heavy operation.
enable_process_sync
changes this detection of a reader process from via file to via shared memory, so that it can detect the updates without writer's call of flush
.
Typical usage:
1. The writer process creates a new writer key. 2. The writer opens storages (context and commit_tree) with the writer key. (Vc.create and Vc.open_for_write do this internally.) 3. The writer sends the writer key to reader processes. 4. The reader processes call enable_process_sync
to enable the faster process synchronization.
The writer and a reader process must run on the same machine to use enable_process_sync
correcly. (In any way, it is not recommended to use Plebeia via network file systems.)
Call of this function with an invalid writer key returns an Error
. Call of this function in the writer process returns an Error
.