Solved

CPU usage during serial I/O

Posted on 2002-06-13
8
133 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:gianluca
ID: 7109042
I tried the patch you suggested but doesn't work; still have 100% USAGE during serial communication.
0
 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

690 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