views:

772

answers:

6

I know that it's possible to implicitly provide asynchronous interaction using:

  • Asynchronous Delegates
  • Asynchronous Callbacks

I was just wondering what other methods .Net supports for asynchronous interaction?

Help greatly appreciated.

Regards

EDIT:

Maybe I didn't explain myself correctly.... I UNDERSTAND THREADING AND CONCURRENCY PERFECTLY, I simply wanted a list of potential ways to implement asychronous interaction in .Net, aside from using asynchronous delegates or callbacks.

A: 

Take a look at this web page, its nicely written with good examples: http://www.yoda.arachsys.com/csharp/threads/

Grzenio
A: 

This might be outside what you're asking, but there is also support for Message Queueing.

ilivewithian
and an example of that would be?
Svish
e.g. http://msdn.microsoft.com/en-us/library/ms978425.aspx
ilivewithian
A: 

Asynchronous operations in .NET are started by calling a method that is named BeginSomething, where Something is probably going to be Invoke, Write, Send or some other operation.

Example:

http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.beginsend.aspx

You pass a delegate of your own that will be executed when the operation completes. You can then get the result of the operation by calling a corresponding method EndSomething.

Example:

http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.endsend(VS.80).aspx

The pattern is usually the same regardless of the operation being performed. There are oddities where the EndSomething method is named something inconsistent instead.

More examples:

Daniel Earwicker
A: 

For me, WCF with MSMQ binding works very nice.

kaze
A: 

(I am not sure I entirely understand what you aim for in your question, but I'll give it a shot)

For allowing asynchronous code execution in winforms applications the BackgroundWorker component is rather convinient. I also often use the ThreadPool.QueueUserWorkItem method as a simple way to spawn a method on its own thread.

Fredrik Mörk
Thankyou very much
Goober
A: 

you could base Expression tress or other monads (not yet allow to link but the term can be found wiki and Calvin has a great blog on the subject as well)

basically everything that allows you to make imparative coding can be used for asyncrounous implementations.

You could also google on continuation passing. A style of coding where all methods do not return values (void) but take a parameter (a delegate of sorts) telleing it what to execute when done.

Rune FS