-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is andor camera code thread-safe? #5
Comments
Hi, we run andor with Lima tango server on beamlines without trouble. Ok the AndorCamera.cpp is maybe not thread-safe enough. But could you tell me more about your tango server random errors? |
Are you using Tango atkpanel tool as client? |
Our usersIt often reports that during acqusiton when they access camera with jive the tango server hangs or crashes randomly. |
humm, I cannot help you without more details. |
I think enough helpful would be to fix the thread-safety bugs by inserting additional |
ok, please make a pull-request, we like contribution. |
Hi,
I've just looked at the andor code because of random errors of its tango server in our facility.
Therefore I would like to ask if someone test the code with respect of thread-safety, i.e.
In
AnodorCamera
there is an implementation of threadAcqThread
(inthreadFunction()
) which shares non-atomics (std::atomic
) variables with the main thread, e.g.:m_cam.m_wait_flag
read inAcqThread
(without lock) but it can be changed instartAcq
or 'stopAcq' (with lock) in the main threadm_cam.m_nb_frames
read inAcqThread
(without lock) but it can be changed insetNbFrames
(without lock) in the main threadm_cam.m_image_number
changed/read inAcqThread
(without lock) but it can be read ingetNbHwAcquiredFrames
in the main thread (without lock)Moreover access to
m_cam.m_buffer_ctrl_obj
(without locks) in both threads looks suspicious(e.g.
newFrameReady(...)
andgetFrameBufferPtr(...)
) .Finally,
WaitForAcquisition()
andGetNumberNewImages(...)
andGetImages16(...)
are implemented in a thread-safe way (Otherwise one has to use mutex for all andor native commands).Best regards,
Jan
The text was updated successfully, but these errors were encountered: