|
Control.Concurrent.TFile | Portability | non-portable (requires STM) | Stability | experimental | Maintainer | Peter Robinson <thaldyron@gmail.com> |
|
|
|
|
|
Description |
A transactional variable that writes its content to a file on each update.
This module should be imported qualified.
|
|
Synopsis |
|
|
|
|
Data type
|
|
|
A transactional variable that writes its content to a file on each update.
- The updated memory content of the TFile is not visible to other threads
until the file has been written successfully.
- If the TFile is "dirty", the content is (re)read from the file on the next
read.
| Instances | |
|
|
Construction
|
|
|
Constructs an initially empty TFile that is marked dirty.
That means, on the next read, the contents of the provided file (if it
exists) will be loaded into the TFile.
|
|
|
|
|
|
Operations
|
|
|
If the TBox is dirty, this retries the transaction and
rereads the content using readIO in a separate thread.
Otherwise it simply returns the result of readSTM.
Note: Depending on the implementation, careless
use of setDirty and read in the same transaction might lead
to nonterminating retry loops.
|
|
|
Writes the new content.
|
|
|
Deletes the content.
|
|
|
Returns True iff the TBox is empty.
|
|
Produced by Haddock version 2.4.2 |