473,396 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 3759
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dynamo | last post by:
Hi, I am still confused as when to use single or double quotes. This works: echo "<td>" . $row . "</td>"; and this does not
4
by: Nuno | last post by:
Is there any SQL Error? Or I have to use Select case in VB code to control SQL instead. Thank you for any ans. Nuno
2
by: Halldór Ísak Gylfason | last post by:
In my application I have an iframe that is empty (and not visible) initially, however when a user presses a button a form is programmatically submitted and the target is set to the IFrame. I...
7
by: sql-db2-dba | last post by:
Does DB2 just fudge it when it is an empty table? Is there a "formula" for average row size when you have variable length records. Or you really have to know what your application is packing into...
4
by: Peter Row | last post by:
Hi, I have created a UserControl which is subsequently hosted on a standard form. My control has a TabControl on it but it has no TabPages configured. At runtime I create X pages and put a...
5
by: AAguiar | last post by:
I have an asp.net project where the code behind the aspx page calls a c# class which makes calls to a managed static C++ class. The C# class works fine when the asp net worker process starts, when...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
44
by: Smokey Grindle | last post by:
I have a list box on my form, but I need to databind it to a data table that is a private member of the form's class... so I basically have Public Class MyForm priate m_MyTable as new datatable...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.