Raising events on separate thread

前端 未结 5 1591
耶瑟儿~
耶瑟儿~ 2020-12-29 06:07

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, e

5条回答
  •  醉梦人生
    2020-12-29 06:49

    100 ns is a very tough target to hit. I believe it will take a deep understanding of what you're doing and why to hit that kind of performance.

    However, asynchronously invoking event subscribers is pretty easy to solve. It's already answered here by, who else, Jon Skeet.

    foreach (MyDelegate action in multicast.GetInvocationList())
    {
        action.BeginInvoke(...);
    }
    

    edit: I should also mention that you need to be running on a real-time operating system to give tight performance guarantees to your users.

提交回复
热议问题