Exemplo n.º 1
0
        //
        private static void EndSum(IAsyncResult ar)
        {
            AsyncFibDelegate del    = (AsyncFibDelegate)ar.AsyncState;
            UInt64           result = del.EndInvoke(ar);

            Console.WriteLine("Fib : " + result);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            AsyncFibDelegate del = Fib;
            IAsyncResult     ar1 = del.BeginInvoke(40, EndSum, del);
            IAsyncResult     ar2 = del.BeginInvoke(35, EndSum, del);
            IAsyncResult     ar3 = del.BeginInvoke(30, EndSum, del);


            Console.ReadKey();
        }