This class defines a database I/O file service that can be shared by multiple threads. This class defines a database I/O file service that can be shared by multiple threads.
More...
This class defines a database I/O file service that can be shared by multiple threads. This class defines a database I/O file service that can be shared by multiple threads.
All threads access a global copy of the database object, and mutex locks can be used to preserve transaction integrety. pread/pwrite calls can be used for optimized I/O when supported.
ThreadFile is meant for use by a threaded database server where multiple threads may each perform semi-independent operations on a given database table stored on disk. A special "fcb" structure is used to hold file "state", and pread/pwrite is used whenever possible for optimized I/O. On systems that do not offer pwread/pwrite, a Mutex lock is used to protect concurrent lseek and read/write operations. ThreadFile managed databases are assumed to be used only by the local server and through a single file descriptor.