I have some code like this
MyClass Foo = new MyClass()
Foo.OnSomeEvent += new SomeEvent(Foo_SomeEvent);
ThreadPool.QueueUserWorkItem(Foo.MyMethod, SomeParams);
My question is that when OnSomeEvent is fired and this method Foo_SomeEvent is invoked, will it be executed under the context of thread under threadpool or is it thread where i am queing an item on ThreadPool?
If it is
Foo.MyMethodthat triggers the event, sinceFoo.MyMethodruns on a thread from the pool then the event callback will also run on a thread from the pool. This is easy to verify:prints on my console: