Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  <19961997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  Index 1994  1995  <19961997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: Re: ca_pend_event()
From: Jeff Hill <johill@lanl.gov>
To: Mark Rivers <RIVERS@cars3.uchicago.edu>
Cc: TECH-TALK@APS.ANL.GOV
Date: Thu, 14 Mar 1996 13:49:32 -0700
Mark Rivers wrote:
> 
>     Folks,
> 
> I just wanted to follow up on Jeff Hill's post regarding my observations on
> the time required for ca_pend_event().
> 
> There is an error in the R3.12 Channel Access Reference Manual. In the
> comments under the description of ca_pend_event() it says that:
>     "A very short TIMEOUT such as .0001 seconds will result in a poll
>      (i.e. channel access will just check for file descriptor activity and
>      then return)."
> 
> This is incorrect. In fact the threshold is 1 microsecond.  Only TIMEOUT
> values below 1 microsecond result in a poll.  TIMEOUTs of 2 microseconds will
> often delay ca_pend_event by 1 tick of the system clock.  Measured values of
> the time required for ca_pend_event(2.e-6) are 10 milliseconds on Sun4 and
> SGI, 1 msec on Alpha, <.4 msec on Solaris.
> 
> Jeff has suggested 2 solutions to the problem (in addition to fixing the
> documentation):
> 
> -  Setting the threshold to (1.0/CLOCKS_PER_SEC). Since CLOCKS_PER_SEC is ansi
>    this would be portable.  Note that, for example, this would result in any
>    TIMEOUT less than 10 msec on a Sun4 result in a poll.
> 

I have made this change however ansi CLOCKS_PER_SEC is 1000000
under sunos4 - therefore the threshold will still be 1uS.

Under vxWorks CLOCKS_PER_SEC is set to sysClockRateGet() and this typically has a value
of 60 - and therefore the threshold will be about 17 mS.


> -  Making the TIMEOUT value which will result in a poll a symbolic constant.
>    Note that the value of SELECT_POLL, defined in iocinf.h cannot be used,
>    since it is defined as 25 msec.

instead I have added a new call - ca_poll() - which will be a macro that
calls ca_pend_event() with a delay short enough to guarantee a poll

Jeff
______________________________________________________________________
Jeffrey O. Hill                 Internet        johill@lanl.gov
LANL MS H820                    Voice           505 665 1831
Los Alamos, NM 87545 USA        FAX             505 665 5107

References:
ca_pend_event() Mark Rivers

Navigate by Date:
Prev: Device support for MKS vacuum gauges? Mark Rivers
Next: Allen Bradley DCM Bret Goodrich
Index: 1994  1995  <19961997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
Navigate by Thread:
Prev: ca_pend_event() Mark Rivers
Next: Device support for MKS vacuum gauges? Mark Rivers
Index: 1994  1995  <19961997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·