Solved

CPU usage during serial I/O

Posted on 2002-06-13
8
130 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 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