[IGSTK-Users] (Micron)Tracker update problem

Patrick Cheng cheng at isis.georgetown.edu
Fri May 22 18:46:17 EDT 2009


Hi Vincent,

Can you try comment out line 57 in igstkMicronTracker.cxx

this->SetThreadingEnabled( true );

This will run the tracker in its default single thread mode.

Can you test to see if there is a performance difference? If we can 
confirm this, we will consider changing the code to be single threaded. 
Also we should probably make the SetThreadingEnabled() method public 
instead of protect, so that user can choose.

Thank you,

Patrick

Vincent Gratsac wrote:
> Hi all,
> 
> I am currently faced to a "locking" problem when using the igstk 
> MicronTracker class.
> 
> This class is multi-threaded :
>    - on one side, a separated thread (#1) communicates with the tracking 
> system by continuously updating tools informations into a buffer 
> (ThreadedUpdateStatus method). This is made in an infinite loop.
>    - on the other side, the principal thread (#0) reads informations 
> from the buffer at a defined frequency, and affect it to TrackerTools 
> objects.
> 
> In order to make this process thread-safe, an Itk MutexLock object is 
> used. My problem is that the separated thread (#1) locks and unlocks 
> this mutex many times without letting the principal thread locking it, 
> for a quite long time (around 100 milliseconds).
> 
> This problem results in jerky effects on the user interface.
> 
> I think that this problem should also happen for other Tracker classes, 
> since this behaviour is implemented in the main Tracker class.
> 
> To resolve this, I would suggest to insert a call to the sleep method in 
> the infinite loop of the separated thread (at least 1 or 2 
> milliseconds), in order to let the principal thread lock the buffer and 
> update TrackerTools informations.
> 
> Did anyone also meet this problem before ?
> Do you think my suggestion could be integrated to the igstk cvs 
> repository ?
> 
> Thank you,
> 
> Vincent
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
> 
> 



More information about the IGSTK-Users mailing list