![]() | ![]() Main Index |
| MCA2 Programmer's Guide | ||||
|---|---|---|---|---|
| Prev | Fast Backward | Chapter 5. How to use blackboards | Fast Forward | Next |
Accessing blackboard without locking is dangerous as then single
values may be changed at the moment of reading and there is a
possibility that data is corrupt. Usually writing and reading elements
is done within Lock/Unlock
blocks.
Nevertheless there are exceptions, where accessing blackboard content
without locking is necessarry and clever. The user is then responsible
for correct updating originals and copies using the functions
ReadUpdate/NonLockingReadUpdate
to transfer data from original to copy,
WriteElement to increment the write counter of an
element, and of course the normal
Lock/Unlock functions
whenever data is to be written.
The tLogReadStream and tLogWriteStream classes are examples of a pair, which accesses blackboard content in such a way.