Dear All,
We are using Python 2.7.12, Tango 9.2 ,PyTango 8.1.8 and taurus 3.7. In our application architecture we have two threads, the main Thread handles GUI updates operation and other thread handles data collection operations. In data collection thread main task is to create device proxy for local as well as remote machine and also collect attribute list(by using get_attribute_list() methods). we are updating the attribute list and it’s properties on regular time interval(5 sec).
We have observed that while reading the attribute or getting attribute list from remote device server, we are suspecting that it holds GIL for 6-12 second. This issue in-turn hangs GUI because main Thread is not getting GIL for that particular time.
I have attached example and log file to support above scenario.In which, I have created two thread, main thread prints Count value and second thread creates device proxy and read attribute repetitively.In this example we observed that main thread get GIL after 10-12 secs.Please go through log file for same.
This is some portion of log file :
2018-03-08 18:59:07,223 MainThread : Thread: MainThread,count:787
2018-03-08 18:59:07,216 Thread-1 : Exception occurred
2018-03-08 18:59:07,223 Thread-1 : Reading attribute Date:
2018-03-08 18:59:13,233 Thread-1 : Exception occurred
2018-03-08 18:59:13,233 Thread-1 : Reading attribute Date:
2018-03-08 18:59:19,244 Thread-1 : Exception occurred
2018-03-08 18:59:19,244 Thread-1 : Reading attribute Date:
2018-03-08 18:59:13,233 MainThread : Thread: MainThread,count:786
2018-03-08 18:59:25,254 Thread-1 : Exception occurred
2018-03-08 18:59:25,254 Thread-1 : Reading attribute Date:
2018-03-08 18:59:25,254 MainThread : Thread: MainThread,count:785
2018-03-08 18:59:31,265 Thread-1 : Exception occurred
2018-03-08 18:59:31,265 MainThread : Thread: MainThread,count:784
Explanation about logs:
In between main thread count 786 to 785, GIL was held by thread 1 which is around 12 second.This is observed throughout the code.
Is this type of behavior expected ? is there anything wrong in our implementation?
If this is the desired behavior then can we have attribute read method with timeout parameter.
Thanks & Regards,
TCS GMRT