Click here to Skip to main content
15,889,597 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to save 2d vector into another 3dvector Pin
Rajesh R Subramanian10-Jun-09 0:19
professionalRajesh R Subramanian10-Jun-09 0:19 
GeneralRe: how to save 2d vector into another 3dvector Pin
CPallini10-Jun-09 0:25
mveCPallini10-Jun-09 0:25 
GeneralRe: how to save 2d vector into another 3dvector Pin
ali kanju10-Jun-09 0:52
ali kanju10-Jun-09 0:52 
JokeRe: how to save 2d vector into another 3dvector Pin
Code-o-mat10-Jun-09 1:09
Code-o-mat10-Jun-09 1:09 
GeneralRe: how to save 2d vector into another 3dvector Pin
molesworth10-Jun-09 1:22
molesworth10-Jun-09 1:22 
GeneralRe: how to save 2d vector into another 3dvector Pin
ali kanju10-Jun-09 1:28
ali kanju10-Jun-09 1:28 
JokeRe: how to save 2d vector into another 3dvector Pin
CPallini10-Jun-09 1:42
mveCPallini10-Jun-09 1:42 
QuestionCan using "CSingleLock::Lock" slow down low priority threads? Pin
LetsMond9-Jun-09 23:09
LetsMond9-Jun-09 23:09 
I have a complex application with many background threads running and I use "CSingleLock::Lock" extensively to lock access to critical data.

I recently noticed a bug where one of my threads was running very slowly and making one of the application's operations almost unusable. After much debugging, I narrowed it down to the thread's repeated use of "CSingleLock::Lock" which is used (along with a CMutex member variable) to lock out some critical data to stop it being used by a different thread, in a different function, at the same time.

My first (obvious) thought was that this second thread was locking the mutex and so causing my original thread to slow down (even though, due to how the threads are used, it is highly unlikely that they will need to access the data at the same time). However I did extensive tests to prove that this was not the case, including stopping the second thread and making sure that my original thread is the only one using the mutex.

It seems that just calling "CSingleLock::Lock" is enough to slow my thread down, regardless of whether the mutex is locked by another thread.

The thread's priority is 0. If I change this to 1 then the problem does not happen. It also only happens on single core PCs.

Has anybody out there encountered a similar issue when using low priority threads?
Is this a common feature of multithreading which I just haven’t seen before?
AnswerRe: Can using "CSingleLock::Lock" slow down low priority threads? Pin
Rajesh R Subramanian9-Jun-09 23:47
professionalRajesh R Subramanian9-Jun-09 23:47 
GeneralRe: Can using "CSingleLock::Lock" slow down low priority threads? Pin
LetsMond10-Jun-09 0:58
LetsMond10-Jun-09 0:58 
GeneralRe: Can using "CSingleLock::Lock" slow down low priority threads? Pin
Rajesh R Subramanian10-Jun-09 1:06
professionalRajesh R Subramanian10-Jun-09 1:06 
AnswerRe: Can using "CSingleLock::Lock" slow down low priority threads? Pin
Stuart Dootson10-Jun-09 0:40
professionalStuart Dootson10-Jun-09 0:40 
AnswerRe: Can using "CSingleLock::Lock" slow down low priority threads? Pin
Randor 10-Jun-09 5:54
professional Randor 10-Jun-09 5:54 
QuestionHow to add a prefix and a postfix to CEdit-derived class? Pin
Yaumen9-Jun-09 22:05
Yaumen9-Jun-09 22:05 
AnswerRe: How to add a prefix and a postfix to CEdit-derived class? Pin
«_Superman_»9-Jun-09 23:17
professional«_Superman_»9-Jun-09 23:17 
Questioncopy chinese to edit control caption will happen garbled text how to solve it Pin
jeansea9-Jun-09 21:15
jeansea9-Jun-09 21:15 
AnswerRe: copy chinese to edit control caption will happen garbled text how to solve it Pin
Rajesh R Subramanian9-Jun-09 21:57
professionalRajesh R Subramanian9-Jun-09 21:57 
GeneralRe: copy chinese to edit control caption will happen garbled text how to solve it Pin
CPallini9-Jun-09 22:03
mveCPallini9-Jun-09 22:03 
GeneralRe: copy chinese to edit control caption will happen garbled text how to solve it Pin
ali kanju9-Jun-09 23:13
ali kanju9-Jun-09 23:13 
GeneralRe: copy chinese to edit control caption will happen garbled text how to solve it Pin
CPallini9-Jun-09 23:23
mveCPallini9-Jun-09 23:23 
GeneralRe: copy chinese to edit control caption will happen garbled text how to solve it Pin
ali kanju9-Jun-09 23:28
ali kanju9-Jun-09 23:28 
GeneralRe: copy chinese to edit control caption will happen garbled text how to solve it Pin
CPallini10-Jun-09 0:12
mveCPallini10-Jun-09 0:12 
GeneralRe: copy chinese to edit control caption will happen garbled text how to solve it Pin
ali kanju10-Jun-09 0:37
ali kanju10-Jun-09 0:37 
GeneralRe: copy chinese to edit control caption will happen garbled text how to solve it Pin
CPallini10-Jun-09 0:45
mveCPallini10-Jun-09 0:45 
GeneralRe: copy chinese to edit control caption will happen garbled text how to solve it Pin
ali kanju10-Jun-09 0:49
ali kanju10-Jun-09 0:49 

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.