Solved

CPU usage during serial I/O

Posted on 2002-06-13
8
127 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

943 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

16 Experts available now in Live!

Get 1:1 Help Now