Critical Section question

Critical Section question

Post by Matt » Wed, 03 May 2000 04:00:00



If a thread throws an exception from within a critical section, what
becomes of the critical section object? Is it released so that other
threads pending on it can continue, or, will the other threads deadlock
because the owner of the object is no longer around to leave the
critical section.

Matt

 
 
 

Critical Section question

Post by Alex Blekhma » Thu, 04 May 2000 04:00:00


AFAIK, other threads will deadlock. You should release all objects in
exception handler's code or __finaly block.

> If a thread throws an exception from within a critical section, what
> becomes of the critical section object? Is it released so that other
> threads pending on it can continue, or, will the other threads deadlock
> because the owner of the object is no longer around to leave the
> critical section.

> Matt


 
 
 

1. Critical Section Question

I have a program that has three threads, 1 main one and two workers.
The main thread has a variable in common with the first worker thread
and has another variable in common with the second worker thread.  SO
what I did was to initialize two CRITICAL_SECTION's in each worker
thread.  I did this because I begin my two worker threads before I
reach the variables that the main thread has in common with them.
However when I do this I get:

ERROR: The instruction at blahblahblah referenced memory at
blahblahblah. The memory could not be written.

Dont know why this occurs.  When I take out one of the critical
sections my program runs fine.  I believe that both critical sections
were set up properly.  Any ideas on why I get this error.  If this is
a stupid question keep in mind im new to multithreading so screw
you... hehe

Thanks

2. FormatMsgWithDoclinks - "Impossible to localize" error

3. WIN32/Critical Section Question

4. Partition Size

5. multimedia timer and critical section question

6. Host Nate Jackson introduces Fuse's TV show

7. VxD question: Critical Sections

8. To Anyone Who Started a Brand New MDSN Subcription in 1999.

9. Application takes 100% CPU on multiprocessor when Leaving a critical section and throwing an exception

10. Critical Sections: Performance? Reliability?

11. Critical Section timeout

12. Exceptions using Critical Sections on NT 3.51

13. Right place for creating a global Critical Section