Click here to Skip to main content
16,010,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHTML help, Keyword problem ! Pin
Hadi Rezaee23-Mar-02 8:05
Hadi Rezaee23-Mar-02 8:05 
GeneralArray problem Pin
23-Mar-02 7:55
suss23-Mar-02 7:55 
GeneralIt works now...thanks Pin
23-Mar-02 8:03
suss23-Mar-02 8:03 
GeneralClear Screen Pin
joeperris23-Mar-02 7:35
joeperris23-Mar-02 7:35 
GeneralRe: Clear Screen Pin
Nish Nishant23-Mar-02 7:42
sitebuilderNish Nishant23-Mar-02 7:42 
GeneralActiveX Pin
syedhassan423-Mar-02 5:56
syedhassan423-Mar-02 5:56 
Generaltime-consuming thread Pin
RichardWdy23-Mar-02 4:28
RichardWdy23-Mar-02 4:28 
GeneralRe: time-consuming thread Pin
Christopher Duncan23-Mar-02 4:41
Christopher Duncan23-Mar-02 4:41 
It sounds like you've got a tight loop in the theaad somewhere, such as:

while(TRUE)
{
// Nothing happens here to give up the cpu
// spins back to top of loop
}

Take a look at any looping you're doing in the thread, and throw in a Sleep() call before you come back aournd to the top of the loop to give up the cup to the next thread.

Sleep(0) will allow the next thread to get some action without a detrimental effect on your performance in the loop. That will probably suffice if this is your problem. If you sleep for an actual amount of milliseconds, keep in mind that in 9x, your minimum granularity (quanta) is 55 milliseconds (I may be off by a couple of milliseconds on the 9x number, been a while) and under NT it's 10 milliseconds, so even if you call Sleep(1), what you'll get will be these minimum slices depending on the platform.

Chistopher Duncan
Author - The Career Programmer: Guerilla Tactics for an Imperfect World (Apress)
GeneralRe: time-consuming thread Pin
RichardWdy23-Mar-02 4:52
RichardWdy23-Mar-02 4:52 
GeneralRe: time-consuming thread Pin
Joaquín M López Muñoz23-Mar-02 4:55
Joaquín M López Muñoz23-Mar-02 4:55 
GeneralRe: time-consuming thread Pin
Christopher Duncan23-Mar-02 4:58
Christopher Duncan23-Mar-02 4:58 
GeneralRe: time-consuming thread Pin
RichardWdy24-Mar-02 0:51
RichardWdy24-Mar-02 0:51 
GeneralRe: time-consuming thread Pin
Christopher Duncan24-Mar-02 6:37
Christopher Duncan24-Mar-02 6:37 
GeneralRe: time-consuming thread Pin
Tim Smith24-Mar-02 6:47
Tim Smith24-Mar-02 6:47 
GeneralDLL Pin
Stan the man23-Mar-02 4:10
Stan the man23-Mar-02 4:10 
GeneralRe: DLL Pin
Joaquín M López Muñoz23-Mar-02 4:50
Joaquín M López Muñoz23-Mar-02 4:50 
QuestionHow to know if my IP is accessible from outside? Pin
Rickard Andersson2023-Mar-02 3:07
Rickard Andersson2023-Mar-02 3:07 
AnswerRe: How to know if my IP is accessible from outside? Pin
Nish Nishant23-Mar-02 3:26
sitebuilderNish Nishant23-Mar-02 3:26 
AnswerRe: How to know if my IP is accessible from outside? Pin
Josh Knox (disabled)23-Mar-02 4:03
Josh Knox (disabled)23-Mar-02 4:03 
AnswerRe: How to know if my IP is accessible from outside? Pin
Anders Molin23-Mar-02 4:05
professionalAnders Molin23-Mar-02 4:05 
QuestionWhat are callback functions Pin
23-Mar-02 2:35
suss23-Mar-02 2:35 
AnswerRe: What are callback functions Pin
Nish Nishant23-Mar-02 2:58
sitebuilderNish Nishant23-Mar-02 2:58 
Generalright to left layout Pin
Drawil23-Mar-02 0:46
Drawil23-Mar-02 0:46 
GeneralRe: right to left layout Pin
moliate23-Mar-02 1:06
moliate23-Mar-02 1:06 
GeneralRe: right to left layout Pin
Drawil23-Mar-02 1:23
Drawil23-Mar-02 1:23 

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.