469,602 Members | 1,962 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

When to use CCriticalSection?

I have an app in which there are 4 threads running simultaneously.
Right now am using "Events" to do the synchronization between threads.

Like, there is a Server writing thread and then there is a Server
reading thread. Once Read thread, reads data from Server, it will Set
an Event for Write thread to continue.

So my question is, In this scenario do i need to use CCriticalSection?

Oct 24 '07 #1
3 3621
"Donos" <do******@gmail.comwrote in message
news:11**********************@i38g2000prf.googlegr oups.com...
>I have an app in which there are 4 threads running simultaneously.
Right now am using "Events" to do the synchronization between threads.

Like, there is a Server writing thread and then there is a Server
reading thread. Once Read thread, reads data from Server, it will Set
an Event for Write thread to continue.

So my question is, In this scenario do i need to use CCriticalSection?

Your question is about MFC and Windows and is off topic here.
I suggest you try microsoft.public.vc.mfc

--
Scott McPhillips [VC++ MVP]

Oct 24 '07 #2
"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcpwrote in message
news:tr******************************@comcast.com. ..
"Donos" <do******@gmail.comwrote in message
news:11**********************@i38g2000prf.googlegr oups.com...
>>I have an app in which there are 4 threads running simultaneously.
Right now am using "Events" to do the synchronization between threads.

Like, there is a Server writing thread and then there is a Server
reading thread. Once Read thread, reads data from Server, it will Set
an Event for Write thread to continue.

So my question is, In this scenario do i need to use CCriticalSection?


Your question is about MFC and Windows and is off topic here.
I suggest you try microsoft.public.vc.mfc
Or comp.programming.threads
Oct 24 '07 #3
Donos <do******@gmail.comwrote in news:1193244358.354939.138170
@i38g2000prf.googlegroups.com:
I have an app in which there are 4 threads running simultaneously.
Right now am using "Events" to do the synchronization between threads.

Like, there is a Server writing thread and then there is a Server
reading thread. Once Read thread, reads data from Server, it will Set
an Event for Write thread to continue.

So my question is, In this scenario do i need to use CCriticalSection?
http://en.wikipedia.org/wiki/Critical_section
http://en.wikipedia.org/wiki/Synchro...ter_science%29
Oct 24 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Dynamo | last post: by
2 posts views Thread by Halldór Ísak Gylfason | last post: by
44 posts views Thread by Smokey Grindle | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.