Raising events on separate thread
I am developing a component which needs to process the live feed and
broadcast the data to the listeners in pretty fast manner ( with about 100
nano second level accuracy, even less than that if I can do that)
Currently I am raising an event from my code which subscriber can
subscribe to. However because in C# event handlers run on the same thread
which raises the event, my thread which raises the event will be blocked
until all subscribers finish processing the event. I do not have control
on subscribers' code, so they can possibly do any time consuming
operations in event handler, which may block the thread which is
broadcasting.
What can I do so that I can broadcast the data to other subscribers but
can still broadcast the stuff quite fast??
No comments:
Post a Comment