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

    Joined:
    Nov 10, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    0
    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

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    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