serial communication makes windows application too slow

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nmsreddi
    Contributor
    • Jul 2006
    • 366

    serial communication makes windows application too slow

    Hi friends ,

    after a long busy work happy to back to forums,

    i have developed a windows application(C#2,0) for serial communication. the aim of my application is to connect to external device(energy meter in my case) and have to get data from the that device . approximately the time to read complete data frfom meter is 10 minutes(may be more also up to one hour in some cases) ,during this time my application is not allowing the user to do other jobs ,some times my mouse pointer is not visible ,what i think is all the system resources are being utilized by this application .

    is there any other solution so that even my application is running ,the user should be able to do other jobs .

    i observed that all application which i have developed specially for serial communication has the same problem . Even i am unable to display a label (for indicating status ) for user indicating that process is in running .


    Any one there for any suggestion.

    Thanks
    nmsreddi
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by nmsreddi
    Hi friends ,

    after a long busy work happy to back to forums,

    i have developed a windows application(C#2,0) for serial communication. the aim of my application is to connect to external device(energy meter in my case) and have to get data from the that device . approximately the time to read complete data frfom meter is 10 minutes(may be more also up to one hour in some cases) ,during this time my application is not allowing the user to do other jobs ,some times my mouse pointer is not visible ,what i think is all the system resources are being utilized by this application .

    is there any other solution so that even my application is running ,the user should be able to do other jobs .

    i observed that all application which i have developed specially for serial communication has the same problem . Even i am unable to display a label (for indicating status ) for user indicating that process is in running .


    Any one there for any suggestion.

    Thanks
    nmsreddi
    Are you using a separate thread for the connection?

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      I would guess that you have a loop performing I/O.
      I/O calls get a pretty good priority, so if you're performing them in a loop (like checking to see if there is data available on the serial port) then you are effective locking down the system since you are demanding high priority actions continuously.

      Comment

      • nmsreddi
        Contributor
        • Jul 2006
        • 366

        #4
        Originally posted by Plater
        I would guess that you have a loop performing I/O.
        I/O calls get a pretty good priority, so if you're performing them in a loop (like checking to see if there is data available on the serial port) then you are effective locking down the system since you are demanding high priority actions continuously.
        Hi friends,
        thanks to all for your reply ,

        what you expected is correct ,i am performing a loop operation to check for the incomming data .i am not using any separate threads for that in my application .

        can you suggest any best way to overcome the situation.

        is threading the only solution for this? or is there any other best way other than threading. because some times threading makes application too complex and unhandled situations may arise.

        Any suggestions Please

        Thanks
        nmsreddi

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Well you can have your loop thread sleep for a short amount of time inside the loop, to give time to other applications.
          You could also use a System.Threadin g.Timer to only call the check for data available every X amount of time (X is configurable in the Timer object). Those happen on a seperate thread as well.

          Comment

          Working...