By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
461,991 Members | 507 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 461,991 IT Pros & Developers. It's quick & easy.

serial communication makes windows application too slow

100+
P: 366
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
Jun 3 '08 #1
Share this Question
Share on Google+
4 Replies

10K+
P: 13,262
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?
Jun 3 '08 #2

Plater
Expert 5K+
P: 7,872
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.
Jun 3 '08 #3

100+
P: 366
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
Jun 6 '08 #4

Plater
Expert 5K+
P: 7,872
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.Threading.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.
Jun 9 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.