RACE - Modifications and Extensions to ACE from Ravensburg
RACE-Replacements and Extensions for ACE
This Classes are for logging from so called Dumpables in a Logfile.
RACE_Message_Blocks
The main reason for the RACE_Messageblocks is Subclassing
- We want to use the MessageQueue for our Dumpables
- Special management data must be handled too
Chaining
RACE_Data_Blocks can be chained like in ACE.
Since the unit to be handled atomarly by the OS is a memory page (i.e. 4096 bytes), it makes little sence to have greater blocks.
- multiple RACE_Data_Blocks are chained for fragmented RACE_Message_Blocks
- The operations rd_ptr() and wr_ptr() refer to one RACE_Data_Block fragment
- the internel current pointer db is switched with first(), advance(), is_done()
Here is an other idea.
RACE_Message_Queue
The Queue is controlled via a strategy class.
Thus, there a strategies thinkable:
- The criteria could be the total number of bytes in the queue or the number message ...
- The Consumer could calculate SnapshotDumpables and feed back them in to the Queue. This feed back must be possible in all conditions, if the feedback is blocked a deadlock occur, because the Consumer is the only one who reads the Queue.
A strategy could be, that the Consumer sees never a full Queue.
- The timeouts for enqueing or dequeuing can be controlled too.
An RACE_Logger, which have in the Active Objekt-Pattern-Realisation an own thread, can schedule Checkpointing/draw snapshots or can garantee a minimal flush rate.
- If the Queue length exeeds a certain level, some RACE_Message_Blocks may be discarded. (A Subclass RACE_Dumpable can marked as discardable).
Caution: I found the length() in an ACE_Message_Block misleading. Thus, a RACE_Message_Block has the operations:
- length()
- which is the actual length from begin to the Write-pointer in the current fragment Datablock
- remaining()
- it is the difference of the read- and writepointer in the current fragment RACE_Datablock
- total_length()
- The sum of all length of all RACE_Data_Blocks in the RACE_Message_Block
The Accumulator
This accumulates the content of Dumpables to the Blocksize of a Filesystem, for example 4096 byte-Blocks.
The Coping is avoided with the use of the writev(2)-Systemcall.
After the Writing, a callback method InformOffset is called.
A Subclass of the Dumpable can overwrite this and thus the Sender of the Dumpable can do the bookkeeping.
Computerscience and Networkassocation Ravensburg e.V Rudolf Weber and friends