Begin Invoke..End Invoke
January 21st, 2008First post in the category
This group is mainly to share coding stuff that is out of layman term. If you are not programmer, stay away at all cost!
Found this very easy to read yet informative post on Asynchronous Method Invocation. I admit that what i know about .NET is merely the tiny tip of what the iceberg can offer. Oh hell, life is long and learning is life long, ain’t it?
Here’s a summary of what i learnt:
- MethodInvoke - built in delegate in .NET that allow you to call a method that takes in no parameter
- BeginInvoke - execute the target function and return to caller instantly
- ThreadPool in .NET has a limit of 25. Avoid ’starving’ the pool else be fined by performance loss
- EndInvoke - return proper values/parameters from the previous function call
- IAsyncResult - log of all datas (exceptions, return value, output parameters, etc) after execution is completed
- AsyncCallBack - used when you don’t wish to wait for completion of the execution (that’s the purpose of asynchronous call bah)
- Command Pattern (ICommand interface) - rather than BeginInvoke, EndInvoke, CallBack everywhere in your Main(), apply this pattern to group calls together.
That’s all folks. I might not have explained everything properly, so best for you to read it yourself.