MantisBT - Hall D Online
View Issue Details
0000400Hall D OnlineMonitoringpublic2014-04-08 10:442014-04-09 09:44
davidl 
davidl 
normalminorN/A
resolvedfixed 
No
0
0
0000400: ROOTSpy: Add mutex lock mechanism for coordinating with user
Synchronization issues can (and sometimes do) occur when the RootSpy thread accesses a histogram or tree at the same time as the main program. We need to provide a mechanism by which they can coordinate. This should be a pthread_mutex_t so that it can be coupled easily with the existing mutex used in GlueX sim-recon code.

The DRootSpy constructor should take an optional pthread_mutex_t* that is initialized to NULL if not given. This will allow any existing code to still compile. A global variable:

   pthread_mutex_t *ROOTSPY_MUTEX = NULL;

should be created and set to the value passed to the DRootSpy constructor if present. If not, then a mutex should be allocated and the pointer set to that. In either case the RootSpy thread should then use the pointer to lock and unlock the mutex for ROOT operations.

 Users that don't provide the mutex pointer can automatically make use of the global ROOTSPY_MUTEX if they wish to synchronize. Otherwise, they are taking their own chances, which is what the situation is now!


No tags attached.
Issue History
2014-04-08 10:44davidlNew Issue
2014-04-08 10:44davidlWork by outside group for Hall D => No
2014-04-08 10:44davidlPercentage complete => 0
2014-04-08 10:44davidlActual man-weeks => 0
2014-04-08 11:10davidlSummaryRootSpy: Add mutex lock mechanism for coordinating with user => ROOTSpy: Add mutex lock mechanism for coordinating with user
2014-04-09 09:44davidlNote Added: 0000585
2014-04-09 09:44davidlStatusnew => resolved
2014-04-09 09:44davidlResolutionopen => fixed
2014-04-09 09:44davidlAssigned To => davidl

Notes
(0000585)
davidl   
2014-04-09 09:44   
This was checked in on 4/9/2014 as svn revision 13200.