Click here to Skip to main content
15,915,087 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: make the mouse pointer to hourglass Pin
David Crow27-Jul-06 3:33
David Crow27-Jul-06 3:33 
AnswerRe: make the mouse pointer to hourglass Pin
Hamid_RT27-Jul-06 3:45
Hamid_RT27-Jul-06 3:45 
QuestionDate Time picker Pin
tanarnelinistit27-Jul-06 3:14
tanarnelinistit27-Jul-06 3:14 
AnswerRe: Date Time picker Pin
David Crow27-Jul-06 3:16
David Crow27-Jul-06 3:16 
QuestionTesting Critical Sections Pin
softwaremonkey27-Jul-06 2:37
softwaremonkey27-Jul-06 2:37 
AnswerRe: Testing Critical Sections Pin
Cedric Moonen27-Jul-06 3:08
Cedric Moonen27-Jul-06 3:08 
GeneralRe: Testing Critical Sections [modified] Pin
softwaremonkey27-Jul-06 3:28
softwaremonkey27-Jul-06 3:28 
GeneralRe: Testing Critical Sections Pin
Cedric Moonen27-Jul-06 3:42
Cedric Moonen27-Jul-06 3:42 
You sqid this:

softwaremonkey wrote:
but how do I really know that the cricial sction has blocked one thread until the other has completed rather than just being (un)lucky and both threads never actually called at the same time?


I understood that you wanted to check if the critical section were working properly, not your code. In that case, I think it is a litle bit useless to verify things that are used by milion of people Wink | ;)

But I understand now (yes, I know, my brain is slow today Poke tongue | ;-P ) that you want to check your code. Something that comes to my mind: in your thread, you can simply make a very lenghty operation (like a double for loop) that is inside a locked section. Then, with the other thread, wait that the critical section is freed. Log the times in a file to see if the second thread is really waiting for the critical section. Of course this is a basic scenario but you can improve it (e.g. use a lenghty operation in both threads)




Cédric Moonen
Software developer

Charting control

GeneralRe: Testing Critical Sections Pin
softwaremonkey27-Jul-06 4:10
softwaremonkey27-Jul-06 4:10 
GeneralRe: Testing Critical Sections Pin
peterchen27-Jul-06 4:18
peterchen27-Jul-06 4:18 
GeneralRe: Testing Critical Sections Pin
S. Senthil Kumar27-Jul-06 5:07
S. Senthil Kumar27-Jul-06 5:07 
GeneralRe: Testing Critical Sections Pin
softwaremonkey27-Jul-06 6:24
softwaremonkey27-Jul-06 6:24 
QuestionGUO in DOS Pin
rajeevktripathi27-Jul-06 2:25
rajeevktripathi27-Jul-06 2:25 
AnswerRe: GUO in DOS Pin
#realJSOP27-Jul-06 2:34
professional#realJSOP27-Jul-06 2:34 
AnswerRe: GUO in DOS Pin
_AnsHUMAN_ 27-Jul-06 2:35
_AnsHUMAN_ 27-Jul-06 2:35 
AnswerRe: GUO in DOS Pin
Monty227-Jul-06 2:37
Monty227-Jul-06 2:37 
GeneralRe: GUO in DOS [modified] Pin
#realJSOP27-Jul-06 3:32
professional#realJSOP27-Jul-06 3:32 
QuestionRe: GUO in DOS Pin
rajeevktripathi27-Jul-06 3:45
rajeevktripathi27-Jul-06 3:45 
AnswerRe: GUO in DOS Pin
#realJSOP27-Jul-06 3:55
professional#realJSOP27-Jul-06 3:55 
AnswerRe: GUO in DOS Pin
Joe Woodbury27-Jul-06 10:38
professionalJoe Woodbury27-Jul-06 10:38 
GeneralRe: GUO in DOS Pin
Gary R. Wheeler29-Jul-06 4:19
Gary R. Wheeler29-Jul-06 4:19 
QuestionHow to get a list of Bluetooth Devices? Pin
LittleYellowBird27-Jul-06 2:24
LittleYellowBird27-Jul-06 2:24 
QuestionHttps with default browsers certificate store Pin
StuartP200227-Jul-06 2:13
StuartP200227-Jul-06 2:13 
Questionconcatenate strings with long Pin
identity_8527-Jul-06 2:01
identity_8527-Jul-06 2:01 
AnswerRe: concatenate strings with long Pin
Cedric Moonen27-Jul-06 2:06
Cedric Moonen27-Jul-06 2:06 

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.