Take the 2-minute tour ×

This is more theoretical question then practical, practically I don't have any performance issue.

I'm trying to figure out how does eventד work (and to deduce if there is a performance penalty for using them instead calling a function).

Is an event is just a class that holds a list of pointers to the function that signed up for the event or there is more behind it ?

share|improve this question

closed as not a real question by Benjamin Gale, Jack Humphries, karthikr, Yasir Arsanukaev, wtsang02 Apr 1 '13 at 0:42


I think your question is answered in this thread: stackoverflow.com/questions/803242/… –  bas Mar 31 '13 at 19:39

1 Answer 1

When an event is raised, a multicast delegate (that essentially gets a new event handler attached to it for every .SomeEvent += MySomeEventHandler that is done on that type instance - it really gets a new delegate list assigned at every +=, but skip that for now) will execute each attached handler. So in every case where more than one event handler is attached, more than one method call will be done. For really low level details, just look at the emitted IL for an event raise situation and compare it to what it looks like when you change the event to a regular callback.

share|improve this answer
