Click here to Skip to main content
15,913,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: _tscanf oddness Pin
Joel Holdsworth12-Sep-04 2:55
Joel Holdsworth12-Sep-04 2:55 
GeneralAlpha in GDI Pin
Joel Holdsworth11-Sep-04 9:32
Joel Holdsworth11-Sep-04 9:32 
GeneralRe: Alpha in GDI Pin
Iain Clarke, Warrior Programmer13-Sep-04 3:41
Iain Clarke, Warrior Programmer13-Sep-04 3:41 
GeneralRe: Alpha in GDI Pin
Joel Holdsworth13-Sep-04 7:39
Joel Holdsworth13-Sep-04 7:39 
GeneralReplicating an instance in a multi-threaded app Pin
0v3rloader11-Sep-04 8:56
0v3rloader11-Sep-04 8:56 
GeneralRe: Replicating an instance in a multi-threaded app Pin
Gary R. Wheeler12-Sep-04 2:58
Gary R. Wheeler12-Sep-04 2:58 
GeneralRe: Replicating an instance in a multi-threaded app Pin
0v3rloader12-Sep-04 5:48
0v3rloader12-Sep-04 5:48 
GeneralUsing a critical section in a high priority thread Pin
Chris Hills11-Sep-04 5:28
Chris Hills11-Sep-04 5:28 
I want to share some data between a thread that has Realtime priority (24) with another thread that has Normal priority (8). The Realtime thread is sending events to a midiOut device, the Normal thread is telling the Realtime thread what volume to use for the events. I might be able to get away without using any sort of exclusion mechanism, but I want to play safe. I’m concerned that a timer interrupt might occur in the middle of a data write, causing the read to be corrupted.

The obvious thing to do is to use a CRITICAL_SECTION, and to get both threads to do EnterCriticalSection()/LeaveCriticalSection() around the code that accesses the shared data. But I’m worried that doing EnterCriticalSection() in a Realtime thread will totally lock up Windows.

So a few questions:

1) If the Normal thread calls EnterCriticalSection(), does that prevent timer interrupts from happening until it calls LeaveCriticalSection()?

2) If the Realtime thread runs when the Normal thread owns the critical section object, so that the call to EnterCriticalSection() in the Realtime thread cannot complete until the Normal thread has released ownership of the critical section object, will this cause any problems? I’m worried that the Normal thread won’t be able to run because it’s been interrupted, and the Realtime thread won’t be able to run because it’s waiting for the critical section object.

3) Will all 32-bit versions of Windows behave in the same way with regard to this possible problem?

Thanks in advance.

Chris.
GeneralRe: Using a critical section in a high priority thread Pin
Baris Kurtlutepe11-Sep-04 8:33
Baris Kurtlutepe11-Sep-04 8:33 
GeneralRe: Using a critical section in a high priority thread Pin
Andrew Walker12-Sep-04 14:37
Andrew Walker12-Sep-04 14:37 
GeneralRe: Using a critical section in a high priority thread Pin
Blake Miller13-Sep-04 6:17
Blake Miller13-Sep-04 6:17 
GeneralRe: Using a critical section in a high priority thread Pin
Andrew Walker13-Sep-04 12:58
Andrew Walker13-Sep-04 12:58 
GeneralVC++6 WinXP - Find Dialog and SerializeRaw don't work Pin
Kwakas11-Sep-04 4:49
Kwakas11-Sep-04 4:49 
GeneralMulti select list control Pin
Tyrus18211-Sep-04 4:17
Tyrus18211-Sep-04 4:17 
GeneralRe: Multi select list control Pin
Gary R. Wheeler12-Sep-04 3:02
Gary R. Wheeler12-Sep-04 3:02 
QuestionHow to issue the mouse_event without "SendInput" Pin
Member 244207211-Sep-04 3:50
Member 244207211-Sep-04 3:50 
GeneralMultiple document templates Pin
Jens Christiansen11-Sep-04 3:10
Jens Christiansen11-Sep-04 3:10 
Generalcalculating response time for a http request Pin
emmatty11-Sep-04 0:36
emmatty11-Sep-04 0:36 
GeneralRe: calculating response time for a http request Pin
Alexander M.,12-Sep-04 4:28
Alexander M.,12-Sep-04 4:28 
Generallist control selection Pin
Tyrus18210-Sep-04 18:51
Tyrus18210-Sep-04 18:51 
GeneralRe: list control selection Pin
Branislav11-Sep-04 4:05
Branislav11-Sep-04 4:05 
GeneralRe: list control selection Pin
Tyrus18211-Sep-04 4:20
Tyrus18211-Sep-04 4:20 
GeneralRe: list control selection Pin
Branislav11-Sep-04 5:04
Branislav11-Sep-04 5:04 
GeneralRe: list control selection Pin
Ravi Bhavnani11-Sep-04 5:07
professionalRavi Bhavnani11-Sep-04 5:07 
GeneralADO MySQL query problem Pin
Graham Holdaway10-Sep-04 16:34
Graham Holdaway10-Sep-04 16:34 

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.