EPICS Home

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  2021  2022  2023  2024  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  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: ca_pend_event()
From: Mark Rivers <[email protected]>
To: [email protected]
Date: Thu, 14 Mar 1996 13:29:13 -0600 (CST)
    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.

-  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.

I think that both of the above suggestions are good ones and should be
implemented.

The performance impact of using the correct values for TIMEOUT can be very
large.  A factor of 5 improvement in the performance of 1000 calls to
ezcaGet() was observed when SHORT_TIME in ezca was redefined from 10
microseconds to 1 nanosecond.

____________________________________________________________
Mark Rivers                             (312) 702-2279 (office)
CARS                                    (312) 702-9951 (secretary)
Univ. of Chicago                        (312) 702-5454 (FAX)
5640 S. Ellis Ave.                      (708) 922-0499 (home)
Chicago, IL 60637                       [email protected] (Internet) 


Replies:
Re: ca_pend_event() Jeff Hill

Navigate by Date:
Prev: Re: Bug in OMS Driver routines Guy Jennings
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  2021  2022  2023  2024 
Navigate by Thread:
Prev: more vxWorks statistics Jim B. Kowalkowski
Next: Re: ca_pend_event() Jeff Hill
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  2021  2022  2023  2024