views:

47

answers:

4

Hi,

Just out of curiosity, does anyone know why the AsynchResult type resides in System.Runtime.Remoting.Messaging as opposed to System.Threading ? It would seem to make more sense to have it declared with all threading types.

Thanks,

Scott

A: 

My guess: Asynchrony can be achieved in more ways that through the use of threads: inter-process communication or inter machine communication immediately come to mind. Messaging is a more generalized abstraction of communication between computational units that do not operate in synchronous lock-step than is threading.

dkackman
+3  A: 

Because that's just one concrete implementation of the System.IAsyncResult interface, and it happens to be an implementation that is used for remoting calls. You can use it elsewhere, but that's not what it's intended for.

Joel Coehoorn
+2  A: 

I have a feeling this particular class is there as one of the concrete implementations of IAsyncResult and IMessageSink interfaces, which is in System.Runtime.Remoting.Messaging itself.

Stan R.
+2  A: 

A fundamental capability that Remoting has is to be able to create a stack frame in another execution context and make a method call. Exactly what is needed to marshal a method call from one thread to another. This is quite non-trivial btw but very well hidden.

Hans Passant