When to use CCriticalSection?

D

Donos

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?
 
S

Scott McPhillips [MVP]

Donos said:
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
 
J

Jim Langston

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

Or comp.programming.threads
 
K

Kenneth Porter

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/Synchronization_(computer_science)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,197
Messages
2,571,041
Members
47,643
Latest member
ashutoshjha_1101

Latest Threads

Top