Click here to Skip to main content
15,925,400 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionStrange include Pin
Monty26-Apr-06 21:21
Monty26-Apr-06 21:21 
AnswerRe: Strange include Pin
toxcct6-Apr-06 22:24
toxcct6-Apr-06 22:24 
Questionthread problem Pin
ramanujachari6-Apr-06 20:52
ramanujachari6-Apr-06 20:52 
AnswerRe: thread problem Pin
Naveen6-Apr-06 20:58
Naveen6-Apr-06 20:58 
GeneralRe: thread problem Pin
Mike O'Neill7-Apr-06 17:04
Mike O'Neill7-Apr-06 17:04 
AnswerRe: thread problem Pin
Matt Godbolt6-Apr-06 21:04
Matt Godbolt6-Apr-06 21:04 
GeneralRe: thread problem Pin
includeh106-Apr-06 21:16
includeh106-Apr-06 21:16 
GeneralRe: thread problem Pin
Matt Godbolt7-Apr-06 4:37
Matt Godbolt7-Apr-06 4:37 
I said as much CPU as there is available to that thread - which is correct as far as I understand. The operating system will split up the CPU time amongst all threads, taking into account thread priority, temporary active window priority boosts and other factors. When you create a thread, unless you specify CREATE_SUSPENDED as a parameter, the other thread will start running immediately. On a multi-processor system that can mean both the parent thread and its child are running concurrently - something to watch out for.

Threads are only slept when they're waiting on an object or they've called 'Sleep()' themselves. In all other cases, even when they're not actually running, the thread is in the 'Ready' state, so the OS will schedule them for running as soon as it can. Thus, a thread will take up as much CPU as there is available.

Matt Godbolt
Engineer, ProFactor Software
StyleManager project
GeneralRe: thread problem Pin
Stephen Hewitt7-Apr-06 2:53
Stephen Hewitt7-Apr-06 2:53 
GeneralRe: thread problem Pin
Blake Miller7-Apr-06 4:08
Blake Miller7-Apr-06 4:08 
GeneralRe: thread problem Pin
Stephen Hewitt8-Apr-06 1:58
Stephen Hewitt8-Apr-06 1:58 
GeneralRe: thread problem Pin
Matt Godbolt7-Apr-06 4:33
Matt Godbolt7-Apr-06 4:33 
AnswerRe: thread problem Pin
Aqueel6-Apr-06 21:19
Aqueel6-Apr-06 21:19 
Questionaccess and deleting of ListBox items Pin
parichaybp6-Apr-06 20:46
parichaybp6-Apr-06 20:46 
AnswerRe: access and deleting of ListBox items Pin
Hamid_RT6-Apr-06 20:50
Hamid_RT6-Apr-06 20:50 
GeneralRe: access and deleting of ListBox items Pin
parichaybp6-Apr-06 21:00
parichaybp6-Apr-06 21:00 
AnswerRe: access and deleting of ListBox items Pin
Naveen6-Apr-06 20:57
Naveen6-Apr-06 20:57 
GeneralRe: access and deleting of ListBox items Pin
parichaybp6-Apr-06 21:13
parichaybp6-Apr-06 21:13 
AnswerRe: access and deleting of ListBox items Pin
Hamid_RT6-Apr-06 21:16
Hamid_RT6-Apr-06 21:16 
QuestionDiff between C Structure and C++ Structure Pin
Krishnatv6-Apr-06 20:40
Krishnatv6-Apr-06 20:40 
AnswerRe: Diff between C Structure and C++ Structure Pin
Matt Godbolt6-Apr-06 20:57
Matt Godbolt6-Apr-06 20:57 
GeneralRe: Diff between C Structure and C++ Structure Pin
Cedric Moonen6-Apr-06 21:04
Cedric Moonen6-Apr-06 21:04 
AnswerRe: Diff between C Structure and C++ Structure Pin
includeh106-Apr-06 20:59
includeh106-Apr-06 20:59 
QuestionUNICODE,_UNICODE question Pin
GDavy6-Apr-06 20:19
GDavy6-Apr-06 20:19 
AnswerRe: UNICODE,_UNICODE question Pin
Nibu babu thomas6-Apr-06 20:24
Nibu babu thomas6-Apr-06 20:24 

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.