Synchronization problem between main thread and worker thread 
Author Message
 Synchronization problem between main thread and worker thread

Hi,

I have a program, which shares data between main thread and worker thread. I
use critical section object to lock the shared data. The deadlock happened
when the worker thread locked the shared data and  is interrupted by a timer
callback function(in main thread) which try to lock the same critical
section object. It seems the timer callback function doesn't relinquish CPU
to the worker thread when it's blocked by the critical section. Is that the
reason cause the deadlock or there is some other reason ? How can I
synchronize shared data between main thread and worker thread ?

Thanks a lot

Chunbo Yang



Tue, 17 Jul 2001 03:00:00 GMT  
 Synchronization problem between main thread and worker thread
Hmmmm....
This should not happen - maybe u have something else which does that - the
timer is simply a message recieved from the system.

U sure u dont have any other sync objects or anything?

--
---
Shahar Prish
DevTeam leader
Maximal Innovative Intelligence

Quote:

>Hi,

>I have a program, which shares data between main thread and worker thread.
I
>use critical section object to lock the shared data. The deadlock happened
>when the worker thread locked the shared data and  is interrupted by a
timer
>callback function(in main thread) which try to lock the same critical
>section object. It seems the timer callback function doesn't relinquish CPU
>to the worker thread when it's blocked by the critical section. Is that the
>reason cause the deadlock or there is some other reason ? How can I
>synchronize shared data between main thread and worker thread ?

>Thanks a lot

>Chunbo Yang



Wed, 18 Jul 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. worker thread vs main thread?

2. Handling events from a worker thread in the main thread

3. component in main threads used in worker threads

4. How to Send messages from worker thread to main thread

5. Posting a message from a worker thread to the main app thread

6. main GUI thread -vs- Main Frame Thread

7. Posting messages to the main window from worker threads

8. COM Threading Model for ISAPI Worker Threads

9. Exe server threading model - events from worker thread question

10. how do i create thread safe worker thread

11. How can i terminate a Worker Thread during a Thread is running?Thank

12. UI Thread better than Worker thread for speed?

 

 
Powered by phpBB® Forum Software