Click here to Skip to main content
15,921,179 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralC++ basic data type questions Pin
Indrawati10-Jun-04 22:48
Indrawati10-Jun-04 22:48 
GeneralRe: C++ basic data type questions Pin
V.10-Jun-04 23:12
professionalV.10-Jun-04 23:12 
GeneralRe: C++ basic data type questions Pin
jmkhael10-Jun-04 23:24
jmkhael10-Jun-04 23:24 
GeneralRe: C++ basic data type questions Pin
Prakash Nadar10-Jun-04 23:41
Prakash Nadar10-Jun-04 23:41 
GeneralRe: C++ basic data type questions Pin
David Crow11-Jun-04 2:24
David Crow11-Jun-04 2:24 
GeneralRe: C++ basic data type questions Pin
Anonymous10-Jun-04 23:42
Anonymous10-Jun-04 23:42 
GeneralRe: C++ basic data type questions Pin
David Crow11-Jun-04 2:22
David Crow11-Jun-04 2:22 
GeneralHyperthreading and Mutexes Pin
[d3m0n]10-Jun-04 22:47
[d3m0n]10-Jun-04 22:47 
Hi all

I recently got a 3.4GHz P4 with HyperThreading (HT). I am getting weird things happening with my threads in my Visual Studio 6 C++ app. I have found that my mutexes are often ignored. This means that the data that the mutexes are protecting becomes invalid causing a GPF.

Example files:
class CBob
{
...
void Func();
CStringList m_listFiles;
CMutex m_mutex;
...
};

void CBob::DisplayFiles()
{
CSingleLock sLock(&m_mutex);
if (sLock.Lock(9000))
{
for (POSITION pos = m_listFiles.GetStartPosition(); pos; )
{
CString strFile = m_listFiles.GetNext(pos);
TRACE(strFile + "\n");
}
sLock.Unlock();
}
else
{
ASSERT(FALSE); //Mutex timeout
}
}

This only happens when I am running in Debug mode with HT enabled. Release mode does not crash even with HT enabled.

Has anyone got any ideas about why enabling hyperthreading causes the mutex to be ignored?

Cheers
Tha d3m0n
GeneralRe: Hyperthreading and Mutexes Pin
Neville Franks11-Jun-04 1:39
Neville Franks11-Jun-04 1:39 
GeneralRe: Hyperthreading and Mutexes Pin
[d3m0n]11-Jun-04 2:05
[d3m0n]11-Jun-04 2:05 
GeneralRe: Hyperthreading and Mutexes Pin
Neville Franks11-Jun-04 7:59
Neville Franks11-Jun-04 7:59 
GeneralRe: Hyperthreading and Mutexes Pin
[d3m0n]13-Jun-04 21:33
[d3m0n]13-Jun-04 21:33 
GeneralVectorization Pin
magpierre10-Jun-04 22:38
magpierre10-Jun-04 22:38 
GeneralRe: Vectorization Pin
Indrawati10-Jun-04 23:00
Indrawati10-Jun-04 23:00 
GeneralRe: Vectorization Pin
Antony M Kancidrowski11-Jun-04 1:06
Antony M Kancidrowski11-Jun-04 1:06 
GeneralC problem Pin
saurabh190510-Jun-04 22:38
saurabh190510-Jun-04 22:38 
GeneralRe: C problem Pin
jmkhael10-Jun-04 23:18
jmkhael10-Jun-04 23:18 
QuestionI eant to Build Installer of my Project .. HOW? Pin
Zeeshan Bilal10-Jun-04 21:40
Zeeshan Bilal10-Jun-04 21:40 
AnswerRe: I eant to Build Installer of my Project .. HOW? Pin
Kapoor Vikrant10-Jun-04 21:52
Kapoor Vikrant10-Jun-04 21:52 
GeneralNested Functions Pin
saurabh190510-Jun-04 21:24
saurabh190510-Jun-04 21:24 
GeneralRe: Nested Functions Pin
Johan Rosengren11-Jun-04 0:36
Johan Rosengren11-Jun-04 0:36 
GeneralRe: Nested Functions Pin
David Crow11-Jun-04 2:17
David Crow11-Jun-04 2:17 
Generalerror! repeatedly calling the same MFC dialog box in vc++ Pin
shiva shankar10-Jun-04 20:59
shiva shankar10-Jun-04 20:59 
GeneralRe: error! repeatedly calling the same MFC dialog box in vc++ Pin
Johan Rosengren10-Jun-04 21:13
Johan Rosengren10-Jun-04 21:13 
GeneralRe: error! repeatedly calling the same MFC dialog box in vc++ Pin
shiva shankar10-Jun-04 22:00
shiva shankar10-Jun-04 22:00 

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.