Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CPU usage during serial I/O

Posted on 2002-06-13
8
Medium Priority
?
138 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
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!

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

636 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