Closed moiri closed 5 years ago
Further add a struct timespec
field to the message structure which is filled with a timestamp upon message creation (use clock_gettime(CLOCK_REALTIME)
).
I am not sure that a message state is the best way to approach this item. I guess that the initial idea was to inform the box implementation about a DL miss in order for it to take appropriate actions. Some thoughts about all of this:
Currently, a TF can be configured in two ways on a DL miss of the producer:
In case 1, I don't see any reason why the box should be informed about the DL miss. After all, the experimenter decided it would be perfectly fine to provide a duplicate of the last message for the consumer to continue its computation. If the consumer must take actions on a DL miss of the producer, certainly a TF would be configured to correspond to case 2.
Concerning case 2, the relevant question is: must a box know whether a DL was missed or is it sufficient for it to know that no message was produced where it should have been?
I can think of two scenarios where such a distinction is necessary:
Conclusion: Yes, DL misses should be reported to to the consumer box, however, in order to keep the read function as simple as possible I would try to avoid a message state but provide a function that allows to query the channel state. In the case of the read function returning NULL the channel state could then be queried in order to take appropriate actions.
In order to communicate deadline misses (or other events) to box implementations the message structure should include a state field.
This field can then be used by the box implementation to take appropriate action.
This means that the
SMX_CHANNEL_READ
macro should only returnNULL
on an unexpected error.