Thread: asynchronous function call

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    asynchronous function call

    Hello everyone,


    I am learning from,

    http://msdn2.microsoft.com/en-us/lib...yc(VS.80).aspx

    two simple questions,

    1. For every degelate we defined (just a normal C# delegate, no special, and not special designed for asynchronous method call purpose), BeginInvoke and EndInvoke will be defined automatically for every delegate, right? (just looks like for every class we defined, toString, GetHashCode, etc. are defined automatically?)

    2. What are the pros and cons compared with the pattern of using EndInvoke to wait for result and the pattern of using WaitHandle to wait for result. To my points, I think they function the same -- block the execution of current thread/method.


    thanks in advance,
    George

  2. #2
    Registered User
    Join Date
    Apr 2008
    Location
    USA
    Posts
    24

    Lightbulb

    Waiting will lock the current invocation until it is complete allowing, upon completion of the current service request, subsequent processing in the current invocation.

    Ending the invocation will close the current invoke upon completion of the current task and will have to be reopened for any other service requests.

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks TheRaven,


    I do not quite understand your below comments, could you show some pseudo code please?

    "Ending the invocation will close the current invoke upon completion of the current task and will have to be reopened for any other service requests."

    Quote Originally Posted by TheRaven View Post
    Waiting will lock the current invocation until it is complete allowing, upon completion of the current service request, subsequent processing in the current invocation.

    Ending the invocation will close the current invoke upon completion of the current task and will have to be reopened for any other service requests.

    regards,
    George

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  2. Help calling function is asm
    By brietje698 in forum C++ Programming
    Replies: 24
    Last Post: 12-06-2007, 04:48 PM
  3. Troubleshooting Input Function
    By SiliconHobo in forum C Programming
    Replies: 14
    Last Post: 12-05-2007, 07:18 AM
  4. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  5. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM