Experimental Physics and
| |||||||||||||||
|
We are using JCA within our accelerator framework. Has anyone dealt with thread safety issues relating to JCA? In particular, I am concerned with switching between asynchronous and synchronous modes of PendEvent. Sometimes we would like to write values immediately, while other times we would like to package changes in a single batch. These operations may take place concurrently in different threads. The solution that we are considering here is to leave PendEvent in synchronous mode and write a higher level wrapper to coordinate batch writes. For example, value requests could be registered with the coordinator. The user then sends a request to push the results to the server and the coordinator wraps requests into a single pend event. In order to prevent conflicts with other threads, we would have to provide a lock to synchronize the pend events. Has anyone already built such a solution? Is there a mechanism to use JCA in a thread safe way? Are there plans for a thread safe version of JCA in the future? Additionally, it seems that within PendEvent.java, the variable m_exit should be declared volatile to ensure that the while loop in the run() method exits immediately when exit() is called. thanks, -tom pelaia -- Tom Pelaia SNS Project, 701 Scarboro Road, MS-6473, Oak Ridge, TN 37831 phone: (865) 574-6421, fax: (865)574-6617
| ||||||||||||||
ANJ, 10 Aug 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |