Click here to Skip to main content
15,885,143 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 25.7K   190   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