Performance issue

This is my first MFC project.  Most if not all of my experiance has been
server side.

I have a front end with multiple CControlBar windows (for docking).  Some of
them need to subscribe to real time messages (stock quotes).  A seperate
thread is receiving messages off of a TCP socket.  This thread then posts
messages to the windows queues for them to retrieve data and update views.

My problem is that my CPU utlization is too high.  Before going through and
optimizing the code I want to see if there is a better (more efficent) way
to update the windows.  Currently there is just one UI thread.  All other
threads in the program post messages back to the individual windows for the
UI thread to handle.

If someone could provide some insite into if this is a good scheme for
handling real time messages I'd appreciate it.



8/1/2003 4:15:23 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 19

>My problem is that my CPU utlization is too high.

Why is it too high? Which aspect of your program is hogging the CPU?

From what you've said, we can only guess - is your thread that reads
from the socket polling - never actually waiting for an OS signal that
new data has arrived, or is it perhaps totally swamped with data? How
many threads do you have?

>I want to see if there is a better (more efficent) way
>to update the windows.  Currently there is just one UI thread.  All other
>threads in the program post messages back to the individual windows for the
>UI thread to handle.

That's a perfectly sane way of doing things. There's rarely a good
reason to have a multi-threaded UI - and they can easily get

davidl (422)
8/1/2003 8:50:23 PM
In message <>, David Lowndes 
<> writes
>That's a perfectly sane way of doing things. There's rarely a good
>reason to have a multi-threaded UI - and they can easily get

Off topic - tell that to the BeOS designers. Apparently the whole UI was 
one thread per window! Wow.

Mind you, BeOS never got anywhere, looked great, probably was, but too 
late, and Linux around the corner.

Stephen Kellett
Object Media Limited
RSI Information:
snail (185)
8/1/2003 9:43:23 PM

Similar Artilces:

Payables Issue-wrong check amount-please HELP
I am using GP 9.0 and have encountered a problem in payables management. This is the second time this has happened. We enter an invoice for $350 for a particular invoice. When its time to pay the invoice, we notice the balance is 320. As we inquire to see why-we don't see any credit memos applied to the invoice. I have done a reconcile with no changes. I don't know what to do but to put in a fake invoice to get it back to $350 so that we can pay the right amount. Does anyone have any ideas why this would happen?? Any input is appreciated Thanks Barb Barb: Have you tri...

Email & IE6.0 Issues
I get this error message when starting Outlook Express 6.0 now. Error 502 Bad Gateway. Also, when using Internet Explorer and I try to email a picture I am unable to send one because it wants me to setup a default. Dialog box pops up with the header. Choose Profile Outlook is in a blank file box that is high lited. On the Options tab there are. Set as default profile. or Shown Logon screens for all information services. If I choose set as Outlook default profil...

viewing fund performance--someone probably has easy fix
How do I view the performance of my investments over time, i.e. 1 mo. 3 mo. and 6mo. I am using the free version of money, but there must be a way to customize my view of my investments in the quotewatchlist. I couldnt find it. In, Andrew wrote: >How do I view the performance of my investments over time, i.e. 1 mo. 3 mo. >and 6mo. I am using the free version of money, but there must be a way to >customize my view of my investments in the quotewatchlist. I couldnt find it. I think you are talking about either the Standard or Deluxe portfolio of MSN Mon...

Issues regarding drawing tools
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Hi <br><br>The Drawing tools are of poor standards when compared with Windows version of Ms office. Why is MS doing this kind of sub-standardizing the quality for mac users who have purchased the licensed product. This is day light robbery. <br><br>I find drawing tools too tedious to work with, for instances if you try to draw a simple arrow, the line is not at all aligned with the arrow head. <br><br>regards - JMohan Contrary to what you apparently believe, Mac Office 2008...

excel 2007 saving issues
I have a file created in excel 2003 that has thousands of VLookup functions. I recently installed excel 2007. When I open this file and try to save it, it will take close to 20 minutes to save. Do you have any ideas on what is slowing this down? Thanks ...

Printing Issue #3
I am trying to make an invitation using publisher 2003. I am required to use a couple of photo's I have got of the school's website but they don't print. Normal clip art images will print but my pictures of the internet won't. I have tried saving them to the computer then using them and also copying and pasting and neither works. I also thought it might be because they were from the net so I used the orignals of a cd and it still did not print. They are being used as an image behind text but even without text over the top they still fail to print. The advance print...

Printer resolution issue
W1B1YjIwMDNdDQpBZnRlciBJJ3ZlIGNoYW5nZWQgKGRlY3JlYXNlZCkgcHJpbnRlciByZXNvbHV0 aW9uIHRoZSB0ZXh0IGluIHB1YmxpY2F0aW9uIGhhZCBiZWVuIHJlZm9ybWF0dGVkLCBwcm9kdWNp bmcgZXh0cmEgfjIwIHBhZ2VzLiBJcyBpdCBiZWhhdmlvdXIgYnkgZGVzaWduPyBIb3cgb3V0cHV0 IGRldmljZSByZXNvbHV0aW9uIGNhbiBhZmZlY3QgdGV4dCBsYXlvdXQ/PyBJcyB0aGVyZSBhIHdh eSB0byByZXR1cm4gcHVibGljYXRpb24gdG8gaXQncyBmb3JtZXIgc2l6ZT8= No, this is not by design, no way does Publisher arbitrarily add 20 pages to a file. Is your printer driver current? -- Mary Sauer "st" <st@sandy.localdomain> wrote in message news:eOl...

Outlook 2003 meeting request issue
Greetings experts! :) Recently we have switched to Outlook 2003 here. (about 50 users) On occasion, meeting requests do not function correctly, in fact, the behaviour is exactly the issue documented in Q307313 about iCalendar interoperability problems, and we experienced this problem during the transition from O2K to O2K3. However, everyone is on O2K3 now, so there should be no problem.. and usually there isn't.. but SOMETIMES, a meeting request comes out just like it did in O2K, like the recepient can't read it.. when this happens, all the recepients of that particular request get ...

Exchange 2003 Relay and security issues
This is a multi-part message in MIME format. ------=_NextPart_000_0022_01C3CFD9.2BD10F80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I'm new to Exchange 2K3 and I'm running into some spammer issues. I = noticed today that my server is being used as a spam machine. I fixed = the error but only drastically by stopping the outbound email. =20 Is there any guide for these type of issues? Is there a way to have = only "authorized" people use my server? I tried changing the access = from anonymous access to the Integr...

Reformatting Issue
I use an Access Query to an Oracle database to pull fields like date and hours. I copy the sheet from Access and paste it into Excel. end up with a bunch of cells containing hours data with that littl green triangle in the upper left corner of the cells. I format th columns to number with 1 decimal, but green triangle remains. The onl way I have found to convert this data is to do an F2/Enter on each cell I have too much data to continue this way. I have the same issue wit the date columns. Any ideas??? Thanks. Bria -- bkube0 ---------------------------------------------------------...

autoformatting issues in excel
How do I input '12-1' in excel without it autoformatting my input to '1-Dec'? Precede entry with apostrophe ' Regards, Peo Sjoblom "student" wrote: > How do I input '12-1' in excel without it autoformatting my input to '1-Dec'? ...

Connecting Outlook through VPN Issues.
Good Morning: Here is my delema. I have a user who is trying to connect to his outlook via VPN and keeps getting prompted for a user name and password. He is able to authenticate the name but every time he tries to log in he gets prompted for the user name and password. The problem I see is that it never asks for a domain to login to. He is part of a workgroup at another office and has CIA installed on his machine. I am at another location with the exact same setup, except I am on a domain, and I can log into the VPN and then log onto his mailbox with no trouble. I am promted ...

M$ response to Login issue
It's worthless, but it is what they have to say. ----------------------------------------- Thank you for using Web Support. My name is Allen, and I'll be assisting you with your case today. To give the most accurate support possible, I would like to give a brief summary of the question as I understand it: You cannot sign into Money with your Passport. If I have misunderstood, please do not hesitate to let me know. I am sorry to hear about the inconvenience you have experienced. We received some feedback from other customers reporting a similar behavior. This matter was i...

Entourage Address Book Issue
While adding names to the Entourage address book, Entourage somehow applied the data from one listing to almost all listings in the category including the photo and addresses and phone numbers from this one listing. Somehow it retained the correct data belonging to the each listing but added all this other data from this source listing. How could Entourage do that? Is there an option for that? How do I get rid of all of this incorrect data? I have a feeling that the answer is one at a time. One click and all was spoilt. Hours to set it right. L ...

Colors and Font Size Issues
When I copy text boxes on to a slide with a different template the text comes in at a much larger font size. These are free text boxes using various font sizes. When I click the paste options to use source formating it does not keep the original font size. Appreciate your help / explanation! PPT 2003, WIN XP. Fritz I saw that recently, and round-tripping the presentation I was copying from seemed to help. Here's instructions how: -- Echo [MS PPT MVP] What's new in PPT 2010? http://www.e...

Character Spacing Issue
I created a document in Word on an XP machine. When I opened the same document in Word on my Mac, the character spacing was noticeably greater, although the font was the same (Franklin Gothic Medium). This caused the layout to be altered as text that originally took one line ran over to two. I have since opened the same document on my same machine using OS X as well as my Windows Boot Camp partition. It is the exact same document but it looks terrible on the Mac. Is there any way to fix this? The disparity is most likely caused by a difference in printer drivers & print settings on the X...

Nz Issue
I need help.. When I add the Nz to the below cell in my query it changes it from currency to text. What can I do to resolve this issue. I am adding Nz because I have some records in this cell that contain no data and I am trying to sum the data in my form. SLS 2006: Nz([SumOfSLS_2006],0) -- Matt Campbell mattc (at) saunatec [dot] com Message posted via Matt, it would probably be better if a nothing or null amount in currency is left as a null. This lets you see where the value for in the currency fiel...

Post-Windows Update Black Screen Issue
Can you provide an update on the status of this: <pft> mcintoshs wrote: > Can you provide an update on the status of this: > > Can who provide it ? There is no official MS presence here, only volunteers. As far as I'm concerned this "story" is an Urban Myth or this newsgroup ...

Business unit issue 04-12-07
We have a few Business units in the system but at one point one of the Business Unit was made the Child of another Business Unit. Now this has been revomed and both Business units are at the same level, instead of one being the child of another. Even then we are still having the issue where by the one Business unit is still see the records record of other Business units, it used to be the parent of. How can we fix this issue, have anyone came across this before? thanks Kyaw Which version of Microsoft CRM are you using as this sounds like the bug that existed on Microsoft CRM 1.2 ...

Quicken to Money 2006 import issues
I tried the import wizard for the Money 2006 trial edition to get 5 years worth of data from my quicken 2003 data file and Money had issues with the file and wouldn't import. I did find I could export the quicken file as a qif and then import it into Money, but there are still some issue: 1. my expense catagories need to be applied to each transaction again 2. All the transaction are marked with a status of (E) when they all but the most recent should be marked as reconciled (R). If the only way around this is to change each transaction manually, I guess I'll have to do it (5...

Excel 2003 Issue with UsedRange.Copy (code works in Excel 2002)
I have been running the below code in an Excel Macro without any issues to copy selective rows of data to a temp1 worksheet based upon a autofilter selection. After I went to Office 2003 Professional for Office XP Pro, I get a run-time error '1004' on the line for the UsedRange.Copy. Does any one know of a fix or why this is happening? 'Filter and copy code: If Worksheets(GLBalance).FilterMode = True Then Worksheets(GLBalance).ShowAllData End If Worksheets(GLBalance).Range(ColGLBalCompanyCode & "1").AutoFilter _ field:=1, _ Criteria1:=szCompanyCode Work...

Strange connectivity issue
Windows XP SP3, Dell laptop. Cannot ping the default gateway, which is our router. Can ping any other computers on the subnet, either by hostname or IP. Other computers on the subnet can ping this laptop, either by IP or hostname. Cannot ping the laptop from the router. The laptop has built-in wireless. If I enable that, I can ping the router's IP address. I tried resetting TCPIP with this command: Netsh int ip reset Didn't help. Windows firewall is disabled. The computer does not appear to have any viruses. Nothing in Event Viewer. I'm stumped. Any ...

M03-WinXP -- Is .MNY file size an issue?
In early 2003 I experienced file corruption problems and an MS support rep helped me to run the salvage program on my .mny file. He told me that my problem resulted from the .mny file's growing too large. It was about 4 meg, which he said was too big. He recommended that I archive every year. I just looked at my file. Haven't archived since the beginning of 2003, so I archived. The .mny file only shrunk from 3.9 to 3.5 meg. Started to look here and read the FAQ page. I see tht some of you recommend against archiving, so I renamed the archive file back to my primary name...

Connectivity Issues
We have recently migrated to a new exachange server, still running 5.5 though. We reconfigured all of the outlooks clients to point to the new server. For some reason, some of the clients continue to function slowly, with a message coming up saying something to the effect of "Please wait while outlook accesses data from FS1 (the old exchange server)". So the clients are looking for something from the old server, which is no longer. We have totally wiped all email settings multiple times, but the problem continues. Any ideas? What about Public Folders? Did you replicate them ov...

Significant issues with Office 2008 and Snow Leopard
Version: 2008 Processor: Intel Hello, Australian user, purchased and installed Snow Leopard this morning (it's 1pm on the 28th). I've got a few major issues with Office 2008: - Installs fine from the media (Office 2008 SP0 / 12.0.0) - Upon launching any Office app, I'm told the database is corrupted. The Database Assistant is unable to repair the issue (or more to the point, it rebuilds 'successfully' but does not remedy the issue). - SP2 will *not* install. It appears to not recognize any OS beyond 10.5, which would be an unusual and poorly designed aspect of the upd...