2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 <2013> 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 <2013> 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | double buffered waveformRecord |
From: | Michael Davidsaver <[email protected]> |
To: | EPICS core-talk <[email protected]> |
Date: | Thu, 03 Jan 2013 17:03:09 -0500 |
All,Recently I was looking at how array fields are handled in database processing and RSRV. In the process I noticed a way to allow double buffering (and possible more creative schemes) of BPTR in the waveformRecord.
This involves playing games with the array offset returned by the get_array_info() record support function, and taking advantage of how this offset is used in dbConvert.c. By doing this I can convince dbGet() and dbPut() to read/write from almost arbitrary locations which can change with each call.
static long get_array_info(DBADDR *paddr, long *no_elements, long *offset) { ... if(prec->bact) { /* cause caller to access buf[1] */ *offset = (prec->buf[1] - prec->buf[0]) / dbValueSize(prec->ftvl); } else { *offset = 0; }
http://bazaar.launchpad.net/~epics-core/epics-base/array-opt/revision/12397 There is also an example device support. http://bazaar.launchpad.net/~epics-core/epics-base/array-opt/revision/12398Now that I have this working I'd like to create a mechanism which doesn't involve abusing 'offset'. So far I've been thinking of allowing get_array_info() to provide a replacement pointer (in addition to offset and length) either by adding another argument, or allowing modification of the DBADDR argument.
Any thoughts/suggestions? Michael The entire branch https://code.launchpad.net/~epics-core/epics-base/array-opt There is also some in-progress changes related to optimizing dbConvert.c.