Click here to Skip to main content
15,792,771 members
Articles / Programming Languages / C#

Thread-safe Events in C#

Rate me:
Please Sign up or sign in to vote.
4.89/5 (12 votes)
11 Mar 2022MIT6 min read 23.1K   182   19  
Discussion on proper method to check for null-value and raise Event in C#
In this article, we discuss three most common ways to check for null-value and raise Event in C#. Thread safety is analyzed. Then, in a small demo program, by creating thread race situation, we attack each solution and demo its thread-safety.

Views

Daily Counts

Downloads

Weekly Counts

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer
Serbia Serbia
Mark Pelf is the pen name of just another Software Engineer from Belgrade, Serbia.
My Blog https://markpelf.com/

Comments and Discussions