Click here to Skip to main content
15,887,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: c++ and ... Pin
toxcct14-Dec-07 0:47
toxcct14-Dec-07 0:47 
GeneralRe: c++ and ... Pin
mostafa_h14-Dec-07 5:18
mostafa_h14-Dec-07 5:18 
QuestionHow to end a thread Pin
Chen-XuNuo13-Dec-07 19:07
Chen-XuNuo13-Dec-07 19:07 
AnswerRe: How to end a thread Pin
Llasus13-Dec-07 19:21
Llasus13-Dec-07 19:21 
GeneralRe: How to end a thread Pin
Chen-XuNuo14-Dec-07 4:32
Chen-XuNuo14-Dec-07 4:32 
AnswerRe: How to end a thread Pin
Mark Salsbery13-Dec-07 19:23
Mark Salsbery13-Dec-07 19:23 
GeneralRe: How to end a thread Pin
Chen-XuNuo14-Dec-07 4:34
Chen-XuNuo14-Dec-07 4:34 
GeneralRe: How to end a thread Pin
Mark Salsbery14-Dec-07 4:58
Mark Salsbery14-Dec-07 4:58 
If that's the case, then you need to debug.

Can you post more specifics on the problem? Does it crash?
If so, on what line? If not, does the thread ever exit?
If not, why? Use breakpoints and single step to find out.
Etc...

Running in the debugger you should be able to find what line of
code is causing problems and trace back to why there's a problem.

Your original code is not going to work correctly. You
MUST manage synchronization of your threads!

Also, using a separate thread doesn't mean less CPU cycles are used,
as implied by your post below. One thread per moving object will start
to degrade performance once you have many objects going at once.
Plus it's wasteful of resources. Even one thread on a modern PC is
capable of tracking and rendering MANY moving objects.
Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: How to end a thread Pin
Chen-XuNuo14-Dec-07 18:03
Chen-XuNuo14-Dec-07 18:03 
GeneralRe: How to end a thread Pin
Mark Salsbery15-Dec-07 7:45
Mark Salsbery15-Dec-07 7:45 
GeneralRe: How to end a thread Pin
Chen-XuNuo14-Dec-07 18:15
Chen-XuNuo14-Dec-07 18:15 
GeneralRe: How to end a thread Pin
Mark Salsbery15-Dec-07 7:33
Mark Salsbery15-Dec-07 7:33 
GeneralRe: How to end a thread Pin
Chen-XuNuo15-Dec-07 3:14
Chen-XuNuo15-Dec-07 3:14 
GeneralRe: How to end a thread Pin
Mark Salsbery15-Dec-07 7:31
Mark Salsbery15-Dec-07 7:31 
GeneralRe: How to end a thread Pin
Chen-XuNuo15-Dec-07 14:52
Chen-XuNuo15-Dec-07 14:52 
AnswerRe: How to end a thread Pin
Cedric Moonen13-Dec-07 20:26
Cedric Moonen13-Dec-07 20:26 
GeneralRe: How to end a thread Pin
Mark Salsbery13-Dec-07 20:38
Mark Salsbery13-Dec-07 20:38 
GeneralRe: How to end a thread Pin
Chen-XuNuo14-Dec-07 4:40
Chen-XuNuo14-Dec-07 4:40 
GeneralC2365 error Pin
subramanyeswari13-Dec-07 18:54
subramanyeswari13-Dec-07 18:54 
GeneralRe: C2365 error Pin
Mark Salsbery13-Dec-07 19:13
Mark Salsbery13-Dec-07 19:13 
GeneralRe: C2365 error Pin
subramanyeswari13-Dec-07 19:59
subramanyeswari13-Dec-07 19:59 
QuestionA non-const reference may only be bound to an lvalue? Pin
George_George13-Dec-07 18:50
George_George13-Dec-07 18:50 
AnswerRe: A non-const reference may only be bound to an lvalue? Pin
Iain Clarke, Warrior Programmer14-Dec-07 1:21
Iain Clarke, Warrior Programmer14-Dec-07 1:21 
GeneralRe: A non-const reference may only be bound to an lvalue? Pin
toxcct14-Dec-07 2:38
toxcct14-Dec-07 2:38 
GeneralRe: A non-const reference may only be bound to an lvalue? Pin
Iain Clarke, Warrior Programmer14-Dec-07 3:29
Iain Clarke, Warrior Programmer14-Dec-07 3:29 

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.