[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

Faster recorders.



While Markm was walking me through the ent and its neighboring
data structures, I figured out how to unload the processing of
updating recorders from the transactions they are recording,
transferring it to reading of the recorders and changing of
the permissions of the item being recorded.

The transaction being recorded (i.e. a bert hop) becomes an
increment of a single variable associated with the item being
metered (i.e. a bert) regardless of the number of recorders on
that item.

Recorders live in two MuSets, one for those which currently have
permission to see the event, one for those that don't.  Each
recorder also has a counter.

The counter in a recorder that currently doesn't have permission
to see the event being recorded contains the count of the events
the recorder has seen, and this is what is returned when the
recorder is interrogated.

The counter in a recorder that currently has permission to see
the event contains the negative of the count of the events it has
missed, and returns the sum of that and the transactor's own
counter when it is interrogated.  (A third MuSet would contain
the sensors from active sessions on cognizant recorders, so the
event could notify interested sessions without examining unsensed
recorders.)

Changing permissions on the item being recorded may result in
moving recorders between sets and updating their saved counters.

In the future we might further reduce the load on permission
changes by storing, not individual recorders, but structures
containing sets of recorders with identical permissions.  The
strucure would have a counter that behaved in the way described,
and each individual recorder would remember the negative of the
value that counter had when the recorder was created, and would
add that to the reutrned value when it was read.  Then only the
counter for the group of recorders would need updating when the
group recorders was moved.  (The group would contain a MuSet of
the sensors on these recorders, to speed adding or removing the
sensors to be notified.)

	michael