kernel.shell.client
Client site control.
Generates and receives messages at a client site. Modifies the global context. Site control operations are assumed to run atomically in a single thread, no synchronization is performed.
generate-heartbeat!
(generate-heartbeat!)
Generates a heartbeat message at a client site. Only required to improve the performance of garbage collection.
generate-inverse-operation!
(generate-inverse-operation!)
TODO: Generates an inverse operation concurrent to all following operations. It should be sufficient to just take the inverted operation’s timestamp, increment it, and use that as the inverse operation’s timestamp.
generate-operation!
(generate-operation! PO-sequence)
Generates a new operation message from a sequence of primitive operations at a client site. The PO sequence CO is assumed to be a valid operation on the current feature model. No operation may be generated when the system is frozen due to conflict.
Creates a compound operation from the PO sequence, then updates the global context. OPTIMIZE: Because generation happens atomically with processing and application, some optimizations are possible: Because CO was generated on the most recent CDAG and HB (and there is also only one CG, otherwise the system is frozen so no conflicts in CP are possible) CP(CO) = all operations in CDAG and HB, so this can be implemented faster than CDAG-insert (whereas the CIP can not be optimized easily).
Calls the MOVIC algorithm with the new operation after the CDAG, HB and CC have been updated. OPTIMIZE: We know (see above), that at generation time there is only one CG and CO has been generated and valid (and targeted at that CG), i.e., the new MCGS will simply be MCGS = {old-CG + {CO}} (CO conjoined on the old CG).
Returns the (updated) combined effect and the generated operation message.
initialize-context-star-topology
(initialize-context-star-topology site-ID {VC :VC, CDAG :CDAG, base-FM :base-FM, HB :HB, CC :CC, MCGS :MCGS, combined-effect :combined-effect, GC :GC})
Initializes global context for a new client site in a star topology. Called when the site is ready to generate and receive operations and the server has transmitted the initial context.
initialize-context-star-topology!
(initialize-context-star-topology! site-ID context)
Initializes global context for a new client site in a star topology. Resets the global context.
receive-message!
Receives a message at a client site. Returns the (updated) combined effect.
resolve-conflict!
Resolves a conflict to a given version. Returns the (updated) combined effect.