Click here to Skip to main content
15,919,774 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralApplication Error with Popup Menu Pin
larryepplin1-Nov-00 8:47
larryepplin1-Nov-00 8:47 
QuestionHow to write screen saver Pin
koteswara1-Nov-00 2:25
koteswara1-Nov-00 2:25 
AnswerRe: How to write screen saver Pin
Member 12089651-Nov-00 6:37
Member 12089651-Nov-00 6:37 
GeneralSound Card input line Pin
Member 3791-Nov-00 0:30
Member 3791-Nov-00 0:30 
GeneralRe: Sound Card input line Pin
Myles1-Nov-00 15:36
Myles1-Nov-00 15:36 
QuestionE-mail in HTML format with MAPI? Pin
Mark Jackson31-Oct-00 22:50
Mark Jackson31-Oct-00 22:50 
GeneralCPU 100% ( Windows NT)` Pin
Kumar31-Oct-00 20:20
Kumar31-Oct-00 20:20 
GeneralRe: CPU 100% ( Windows NT)` Pin
Member 12089651-Nov-00 7:03
Member 12089651-Nov-00 7:03 
In multithreaded programming, you must be careful not to monopolize the CPU. The OS of course looks after scheduling, but it's up to you to let the OS know that you don't need every available timeslice for your loop.

A simple thing to do is to Sleep() your thread for a reasonable period of time between checks to see if it has work to do.

As a simple test, try putting Sleep(500) somewhere inside your loop and see what kind of effect it has on your CPU usage. You likely should architect a more elegant solution than a simple Sleep() call, one that better matches your program logic, but this should get you started.

You should also check out WaitForSingleObject() and its cohorts, it may make sense for your app.
GeneralRe: CPU 100% ( Windows NT)` Pin
Dark Angel3-Nov-00 5:02
Dark Angel3-Nov-00 5:02 
QuestionHow do you create a GUI thread? Pin
Dave31-Oct-00 17:13
Dave31-Oct-00 17:13 
AnswerRe: How do you create a GUI thread? Pin
Ryan Park1-Nov-00 13:40
Ryan Park1-Nov-00 13:40 
GeneralUNC Pin
R31-Oct-00 12:59
R31-Oct-00 12:59 
GeneralDirectDraw -- Please help me! Pin
kk931-Oct-00 11:58
kk931-Oct-00 11:58 
QuestionHow to stop paper advance after printing a page Pin
Brian Nguyen31-Oct-00 10:48
Brian Nguyen31-Oct-00 10:48 
GeneralAssembly in Visual C++ IDE Pin
rick200031-Oct-00 8:13
rick200031-Oct-00 8:13 
GeneralJob Scheduler Pin
Wilson31-Oct-00 6:54
Wilson31-Oct-00 6:54 
QuestionHow can I acces to voriables of other program? Pin
Peter Pawluczuk31-Oct-00 6:15
sussPeter Pawluczuk31-Oct-00 6:15 
AnswerRe: How can I acces to voriables of other program? Pin
Christian31-Oct-00 10:16
Christian31-Oct-00 10:16 
QuestionHow can I acces to voriables of other program? Pin
Peter Pawluczuk31-Oct-00 6:14
sussPeter Pawluczuk31-Oct-00 6:14 
QuestionHow to change user privileges programmatically? Pin
sai31-Oct-00 3:48
sai31-Oct-00 3:48 
GeneralMS Tabbed Dialog Ctrl 6 Pin
Prabhakar31-Oct-00 0:00
Prabhakar31-Oct-00 0:00 
GeneralRe: MS Tabbed Dialog Ctrl 6 Pin
KayKay31-Oct-00 4:26
KayKay31-Oct-00 4:26 
GeneralRe: MS Tabbed Dialog Ctrl 6 Pin
Prabhakar31-Oct-00 17:36
Prabhakar31-Oct-00 17:36 
GeneralMultilanguage application Pin
André Dewispelaere30-Oct-00 21:22
André Dewispelaere30-Oct-00 21:22 
GeneralSorting data in CListCtrl columns... Pin
Ammar30-Oct-00 20:56
Ammar30-Oct-00 20:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.