Closed marciodo closed 3 years ago
This fixes a lot of issues for us so I will pick it back up. I will do the following:
pthread
, I will modify it to use epicsThread
* I'm a little worried this is being quite aggressive in how much it throws away...
I was a little worried about the whole thing, too. :-)
Fixed merge and build issues. Was going to work on documentation and other issues with @rerpha.
@marciodo, would you be able to give myself and @rerpha permission to push to this branch?
@DominicOram, I've created a collaborator invitation for both of you. Thank you a lot for working on this. I'll test the fixes later.
@dirk-zimoch and @marciodo, could we have a chat tomorrow about how to find a good balance between performance and throwing away messages?
@dirk-zimoch, @marciodo and @rerpha. Could we meet in one of the zoom breakout rooms at say 15:30 UTC?
OK.
I've written up what we discussed in https://github.com/paulscherrerinstitute/StreamDevice/issues/67, I'll have a go at doing it in the next few days
A different approach has been implemented.
The idea is to have a thread that controls when a message should be printed based on a configurable timeout. I tried to make the changes generic, not dependent on EPICS, but it was not fully accomplished. To activate the message engine, an IOC shell function must be used: streamMessageTimeout with the number of seconds of timeout.
The changes are fully compatible with the current version of Stream Device as, if the user doesn't call streamMessageTimeout, the behavior is still the same as before.
Instead of comparing strings, I decided to group the calls to the error macro in numeric categories. This would avoid a frenetic string comparison in the case of hundreds of messages per second being print, which could impact the performance of the message engine.
This is the data structure and the algorithm developed:
These are the needed changes in StreamError.h and StreamError.cc.