Experimental Physics and
| |||||||||||||||||
|
Locking and/or re-reading might be possible for SNL code accessing the variables but what about escaped C-Code? You probably have to take the lock before escaping to C but then nobody is allowed to do blocking things in that code. A layer of "shadow variables" might be safe. CA updates the shadow copy at any time while the state code executes. Only during the state transition and inside pvGet the data is transfered to the "user copy". (any back inside pvPut). CA has to be locked out only during these copy actions. Of course that requires twice the amount of memory for variables plus some time for the additional copy. Concerning double: On the new PPC 500v2 core it takes indeed two assembler instructions to load or store a double. Thus doubles are non-atomic. By the way, I think arrays are already unsafe on the server! If the array record processes and updates the array at the same time as it is sent on the network by CA, the user gets a half old/hald new array. This is because only the pointer to the array is put into the queue for the CA thread, not the array data itself. (I am happy if somebody could prove me wrong.) Best regards, Dirk Benjamin Franksen wrote: On Friday 21 May 2010, Andrew Johnson wrote:On Thursday 20 May 2010 17:53:04 Benjamin Franksen wrote:This bug must have been in the sequencer for a long, long time, probably right from the beginning.I'm not convinced it's quite as bad as you think; I suspect it derives from R3.14.x when Jeff introduced the ca_enable_preemptive_callback option. Before this time the CA library never got a chance to process network messages unless you called it using ca_pend_event() or ca_pend_io() so the callbacks would only run when the thread was inside the CA library.
| ||||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |