I want to stop the current synchronous process to stop and continue with an asynchron

Discussion in 'C#' started by Leo, Jan 25, 2007.

  1. Leo

    Leo New Member

    Nov 10, 2006
    Likes Received:
    Trophy Points:
    Pls help . this is urgent I have put in detail.

    This is three layer of C# files.

    I have a interface method which calls the Load() method in file1.cs which inturn calls LoadFile method is file2.cs.

    In the LoadFile method in file2.cs , it makes a call to an "Upload" method which is part of the synchronous process.

    After the Upload process is over , i enable a timer which keeps on looking for a specific status from the Webservice.And only once a specific status is got, the timer will be stopped and the control should go back to the Load() method in file1.cs.

    But what happens is that once the upload process is over and when the timer is enabled the control goes back to the Load() method in the file1.cs file and the timer event is executed.After some number of execution of timer event , the control goes back to the interface and then comes back to the timer event again.

    Since this execution is through a back end scripts, the control should come back to the interface only after the entire process is over.Then the status can be checked at the interface only whether is load is in progress or not.

    If in progress dont do anything and if load is over stop.
  2. shabbir

    shabbir Administrator Staff Member

    Jul 12, 2004
    Likes Received:
    Trophy Points:
    That should not happen because the timer will be started in the CPU and with the tick it will be called and the timer creater thread wil not be waiting for that ticks there is something definitely wrong in either the implementation or making of your assumptions in the control flow.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice