Up Next
Go up to Sort enhancement for function execution
Go forward to SYM4D command for 4D (hypercube) sorting

Synchronizing activities

A compression facility in a nD sort will require event-by-event output in list-mode, with periodic clearing out and compressing. This would be accomplished by a tidy routine, so we define a third necessary function ...


exectidy_<function-name>()


The tidy function may be spawned:

a) once as a thread in the execinit routine and wait on a condition, or

b) each time it is required and exit on completion.

The tidy function will usually be actioned in the execsort function, but would also need to be actioned in the sort_flush function at the end of the run. Hence we need a mechanism of hooking routines into a list to be executed at certain times.

This is done by defining a function that would be called within the execinit routine to add a routine to the hooklist:


flush_hook_add(exectidy_<function-name>)


This needs a function pointer array defining, which is initialised to nulls. The non-null functions in the array would be executed at a suitable point.


support@ns.ph.liv.ac.uk

Up Next