468,770 Members | 2,396 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,770 developers. It's quick & easy.

serial communication makes windows application too slow

366 256MB
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
4 1920
r035198x
13,262 8TB
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
7,872 Expert 4TB
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
nmsreddi
366 256MB
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
7,872 Expert 4TB
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.

Similar topics

3 posts views Thread by carmen | last post: by
6 posts views Thread by Leandro Berti via DotNetMonster.com | last post: by
19 posts views Thread by ... | last post: by
38 posts views Thread by shussai2 | last post: by
4 posts views Thread by =?Utf-8?B?RG91ZyBE?= | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.