Solved

CPU usage during serial I/O

Posted on 2002-06-13
8
126 Views
Last Modified: 2010-04-04
I'm writing a program in which I continuosly use serial communication with a separate thread. If I use OVERLAPPED function to read/write data over serial port, the overall performance seems very good but CPU USAGE goes to 100%!!! If I use NON-OVERLAPPED I/O functions, performance decrease but CPU USAGE drop to 0-1%!!!! I'm using Delphi 6 with Win200 Professional. I don't know if this is true, in both cases I don't see any slowdown using other application.
0
Comment
Question by:gianluca
8 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 7075178
Delphi is famous for a synchronisation bug in that area. The symtom is 100 % CPU usage. Have a look at the bugfixes from Borland for Delphi 6.
0
 

Author Comment

by:gianluca
ID: 7107655
CPU usage indication is really true ??? Even if I don't use Synchronize method and any kind of synchronization still have CPU usage always 100% with overlapped I/O and 0% with non-overlapped I/O.
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 7107765
A basic class of Delphi TMultiReadExclusiveWriteSynchronizer is very buggy (even buggier in Delphi 6). It has to do with general thread handling.
There is a special bugfix for Delphi 6 SP2 on Code Central. Get it and use it.
0
 

Author Comment

by:gianluca
ID: 7109042
I tried the patch you suggested but doesn't work; still have 100% USAGE during serial communication.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:gianluca
ID: 7118230
Any suggestion ???
0
 

Author Comment

by:gianluca
ID: 8321330
I still have the same problem with D7
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9010664
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ and Refund

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 9102376
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now