kou2pinso

AF SDK Deadlock when main thread waiting for AF Access end

Discussion created by kou2pinso on Mar 22, 2012
Latest reply on Apr 24, 2012 by mhamel

  Normal   0       21       false   false   false     FR   X-NONE   X-NONE                                        MicrosoftInternetExplorer4                                                                                                                                                                                                                                                                                                                       

 

Hello,

 

We meet a dead lock between AF SDK access and our application main thread.

 

We have a timer raised every 5 seconds.  On the timer event, the application read lots of data through AF SDK.  In some condition, when the user clicks a menu or exiting the application, the application stops the timer and waits for its callback completion. This action locks the main thread of the application and the current access of the AF SDK never ends.

 

The following diagram sequence illustrates the deadlock conditions.

 

6320.AfDeadLockSequenceForOsisoft.jpg

 

Note that if we force the free of the main thread, the AF SDK respond immediately.

 

Our first thought was that there is a conflict between COM PI point and STA thread, but we failed to reproduce the issue in a simple application.

 

Does anyone have simillar  issue?
Does AF / PI SDK needs application main thread never lock to perform some operations?
Which precautions should we take to avoid this issue?

 


Any helps or suggestion are welcome.

 

 

 

Thanks.

 

 

 


Outcomes