No, not thread safe. The instance member access of the List class itself are NOT thread safe, as per MSDN under Thread safety The method itself is not thread safe 2 threads could enter the method at the same time Both try to get the FirstOrDefault Both get nothing Both add a new TEventType I would switch to one of the System. CollectionConcurrentX collections in .
NET 4 msdn.microsoft.com/en-us/library/system.... or do your own locking.
1 @Peter Agreed. I came here to sanity check after having some issues and then looking at the code for EventAggregator in reflector. I cannot believe that they did not make it thread-safe given the intended architectural use.
I was surprised anyway. – chibacity Sep 15 '10 at 13:00 @chibacity me too, surprised I was ;-) – Peter Gfader Sep 20 '10 at 4:00.
It depends what "_events" is... There are some awesome new thread-safe classes in . NET 4 ... Check out msdn.microsoft.com/en-us/library/system.....
Sorry, I should have included it. It's just a list : private readonly List _events = new List(); – pfaz May 14 '10 at 14:42.
Well, based on that code paste, I'd say no, it's not 100% thread safe. Of course, you have the source, so you can just add the lock yourself. :) Actually, as a general rule of thumb, I include the entire CAL project in my solution, at least at the start.It helps a lot in debugging those odd region registration/creation exceptions...
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.