Question about program flow and event handlers

Posted on 2009-04-16
Last Modified: 2012-05-06

Lets say I have a method that raises an event by called the INvoke method of a delegate. Lets say the method looks like this psuedocode

Sub OnEvent()
 Statement a
 Statement b

When the Invoke method is called does program control pass to the invoke method or does the invoke method go off and run in a separate thread. I think I remember reading that program control passes to the invoke method and then control returns to the OnEvent method after the invoke method has finished. Is this correct? I also think I remember reading that if multiple event handler methods are stored in the delegate you can't guarantee anything about the order in which they are executed.

Question by:andieje
    LVL 4

    Accepted Solution


    Author Comment

    thanks for posting but those links don't provide answers to the questions i asked
    LVL 4

    Expert Comment

    If you read through the information in the link it will answer your question, such as the fact that you are correct about your assumption regarding delegate function execution and the order of it in the context of the function.  It also talks about storing several in a delegate group, etc.

    Please read through the info and then let me know if you still have questions and what exactly you need clarification on.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video discusses moving either the default database or any database to a new volume.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now