Click here to Skip to main content
15,906,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralW2k - time division - registry key Pin
Ștefan-Mihai MOGA24-Oct-02 14:36
professionalȘtefan-Mihai MOGA24-Oct-02 14:36 
QuestionHow do i scale a DC? Pin
Miguel Lopes24-Oct-02 12:11
Miguel Lopes24-Oct-02 12:11 
AnswerRe: How do i scale a DC? Pin
alex.barylski24-Oct-02 13:02
alex.barylski24-Oct-02 13:02 
GeneralRe: How do i scale a DC? Pin
Miguel Lopes24-Oct-02 13:12
Miguel Lopes24-Oct-02 13:12 
GeneralRe: How do i scale a DC? Pin
alex.barylski24-Oct-02 14:44
alex.barylski24-Oct-02 14:44 
GeneralRe: How do i scale a DC? Pin
alex.barylski24-Oct-02 16:20
alex.barylski24-Oct-02 16:20 
GeneralRe: How do i scale a DC? Pin
Miguel Lopes31-Oct-02 6:47
Miguel Lopes31-Oct-02 6:47 
GeneralCritical sections (Moak & Co.) Pin
Rickard Andersson2024-Oct-02 11:23
Rickard Andersson2024-Oct-02 11:23 
Hey again!

I haver found something in the MSDN:

CRITICAL_SECTION GlobalCriticalSection; 

// Initialize the critical section.
InitializeCriticalSection(&GlobalCriticalSection); 

// Request ownership of the critical section.
__try 
{
    EnterCriticalSection(&GlobalCriticalSection); 
    // Access the shared resource.
}
__finally 
{
    // Release ownership of the critical section.
    LeaveCriticalSection(&GlobalCriticalSection);
}


Inside the try clause I access all my global data I want to access in my thread and other running threads that try access the same data has to wait untill the critical section is over (in the finally clause)... RIGHT?

Did I understand this code right or wrong?

Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!

UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!

GeneralRe: Critical sections (Moak & Co.) Pin
Daniel Turini24-Oct-02 11:32
Daniel Turini24-Oct-02 11:32 
GeneralRe: Critical sections (Moak & Co.) Pin
Rickard Andersson2024-Oct-02 11:36
Rickard Andersson2024-Oct-02 11:36 
GeneralRe: Critical sections (Moak & Co.) Pin
Daniel Turini24-Oct-02 11:41
Daniel Turini24-Oct-02 11:41 
GeneralRe: Critical sections (Moak & Co.) Pin
Joe Woodbury24-Oct-02 11:50
professionalJoe Woodbury24-Oct-02 11:50 
GeneralRe: Critical sections (Moak & Co.) Pin
Joe Woodbury24-Oct-02 11:35
professionalJoe Woodbury24-Oct-02 11:35 
GeneralRe: Critical sections (Moak & Co.) Pin
Rickard Andersson2024-Oct-02 11:40
Rickard Andersson2024-Oct-02 11:40 
GeneralRe: Critical sections (Moak & Co.) Pin
Joe Woodbury24-Oct-02 11:55
professionalJoe Woodbury24-Oct-02 11:55 
GeneralRe: Critical sections (Moak & Co.) Pin
Rickard Andersson2024-Oct-02 21:38
Rickard Andersson2024-Oct-02 21:38 
GeneralRe: Critical sections (Moak & Co.) Pin
Joe Woodbury25-Oct-02 1:09
professionalJoe Woodbury25-Oct-02 1:09 
GeneralRe: Critical sections (Moak & Co.) Pin
Rickard Andersson2025-Oct-02 5:53
Rickard Andersson2025-Oct-02 5:53 
GeneralRe: Critical sections (Moak & Co.) Pin
Joe Woodbury25-Oct-02 6:46
professionalJoe Woodbury25-Oct-02 6:46 
GeneralRe: Critical sections (Moak & Co.) Pin
Moak24-Oct-02 19:35
Moak24-Oct-02 19:35 
GeneralRe: Critical sections (Moak & Co.) Pin
Rickard Andersson2024-Oct-02 21:39
Rickard Andersson2024-Oct-02 21:39 
GeneralRe: Critical sections (Moak & Co.) Pin
Anonymous24-Oct-02 22:08
Anonymous24-Oct-02 22:08 
QuestionHow to detect a CView closing? Pin
Ravi Bhavnani24-Oct-02 11:19
professionalRavi Bhavnani24-Oct-02 11:19 
AnswerRe: How to detect a CView closing? Pin
Ravi Bhavnani24-Oct-02 11:20
professionalRavi Bhavnani24-Oct-02 11:20 
GeneralRe: How to detect a CView closing? Pin
Neville Franks24-Oct-02 12:00
Neville Franks24-Oct-02 12:00 

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.