Click here to Skip to main content
15,892,643 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Global vs local variables Pin
Waldermort5-Sep-07 0:52
Waldermort5-Sep-07 0:52 
QuestionRe: Global vs local variables Pin
rajeevktripathi5-Sep-07 0:58
rajeevktripathi5-Sep-07 0:58 
AnswerRe: Global vs local variables Pin
Waldermort5-Sep-07 1:10
Waldermort5-Sep-07 1:10 
QuestionRe: Global vs local variables Pin
rajeevktripathi5-Sep-07 1:38
rajeevktripathi5-Sep-07 1:38 
AnswerRe: Global vs local variables Pin
jhwurmbach5-Sep-07 2:22
jhwurmbach5-Sep-07 2:22 
AnswerRe: Global vs local variables Pin
Naveen5-Sep-07 2:13
Naveen5-Sep-07 2:13 
AnswerRe: Global vs local variables Pin
David Crow5-Sep-07 4:53
David Crow5-Sep-07 4:53 
QuestionReader Writer lock Pin
Waldermort5-Sep-07 0:50
Waldermort5-Sep-07 0:50 
Would this warrent taking any safeguards for reader writer lock?

Thread 1 pushes items to the back of a vector.
Thread 2 pops the first item ( if not empty ), does some action, and loops constantly.

The vector contains only pointers. I'm not worried about the execution time of thread 2, but it's critical that Thread 1 isn't required to wait? Using Mutex's or critical sections all involve using the WaitXXX functions. If a safeguard is required, would setting a simple bool be adequate enough to prevent Thread 2 from reading the data while Thread 1 is writing?
AnswerRe: Reader Writer lock Pin
chandu0045-Sep-07 1:42
chandu0045-Sep-07 1:42 
AnswerRe: Reader Writer lock Pin
Matthew Faithfull5-Sep-07 1:52
Matthew Faithfull5-Sep-07 1:52 
GeneralRe: Reader Writer lock Pin
Waldermort5-Sep-07 2:44
Waldermort5-Sep-07 2:44 
GeneralRe: Reader Writer lock Pin
El Corazon5-Sep-07 5:02
El Corazon5-Sep-07 5:02 
GeneralRe: Reader Writer lock Pin
El Corazon5-Sep-07 5:34
El Corazon5-Sep-07 5:34 
GeneralRe: Reader Writer lock Pin
Waldermort5-Sep-07 6:17
Waldermort5-Sep-07 6:17 
GeneralRe: Reader Writer lock Pin
El Corazon5-Sep-07 7:38
El Corazon5-Sep-07 7:38 
GeneralRe: Reader Writer lock Pin
Matthew Faithfull5-Sep-07 5:49
Matthew Faithfull5-Sep-07 5:49 
GeneralRe: Reader Writer lock Pin
Waldermort5-Sep-07 6:15
Waldermort5-Sep-07 6:15 
AnswerRe: Reader Writer lock Pin
Matthew Faithfull5-Sep-07 6:28
Matthew Faithfull5-Sep-07 6:28 
GeneralRe: Reader Writer lock Pin
El Corazon5-Sep-07 7:42
El Corazon5-Sep-07 7:42 
GeneralRe: Reader Writer lock Pin
Matthew Faithfull5-Sep-07 9:30
Matthew Faithfull5-Sep-07 9:30 
GeneralRe: Reader Writer lock Pin
El Corazon5-Sep-07 9:52
El Corazon5-Sep-07 9:52 
QuestionA very basic question Pin
HakunaMatada5-Sep-07 0:24
HakunaMatada5-Sep-07 0:24 
AnswerRe: A very basic question Pin
Matthew Faithfull5-Sep-07 0:47
Matthew Faithfull5-Sep-07 0:47 
AnswerRe: A very basic question Pin
Waldermort5-Sep-07 0:58
Waldermort5-Sep-07 0:58 
AnswerRe: A very basic question Pin
Hamid_RT5-Sep-07 1:02
Hamid_RT5-Sep-07 1:02 

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.