EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  <20012002  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  1996  1997  1998  1999  2000  <20012002  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: RE: channel access
From: "Jeff Hill" <[email protected]>
To: "john sinclair" <[email protected]>, "tech talk" <[email protected]>
Date: Mon, 19 Nov 2001 12:22:20 -0700
> Is this behavior reasonable? Does pend event do something fundamentally
> different from pend io?

Yes. If you have not made any of the following IO requests since the last
call to ca_pend_io() (or the start of the program whichever is first), then
ca_pend_io() will have no effect other than to flush the output queue,
and ca_pend_io() will return immediately without blocking for the duration
of the specified time out.

1) created a CA channel (without specifying a connection call back handler)
2) made a CA get request (without specifying an IO completion call back handler)

In contrast ca_pend_event() will always process CA background activity
for the full duration of the specified timeout and until all queued
labor has been processed by CA. 

You should call ca_poll() or ca_pend_event(1e-12) in the background at least 
a 10 Hz rate. Alternatively, in EPICS R3.14 if your application is thread safe, 
you can enable preemptive call backs and not bother with polling ca_pend_event().

Jeff

> In the course of testing edm, I have noticed the following behavior for
> some configurations (unfortunately, I don't mean anything precise when I
> say "some configurations"):
> 
>   I run a fresh copy of edm, bring up a display containing ~9000
>   references to the same pv  and execute it. This adds ~9000 events to the
>   ioc (or portable CAS). Performance is good.
> 
>   I now deactivate the display which clears all the events.
> 
>   From this point on, when this or any other display is executed, the
>   performance is such that it takes twice as long to complete the
>   process of adding all the events.
> 
> 
> 
> At this point the code looked something like the following:
> 
> ====================================
> 
>   for all pvs {
> 
>     add events
> 
>   }
> 
>   ca_pend_io( time )
> 
> ====================================
> 
> 
> 
> So, I changed this to
> 
> ====================================
> 
>   count=0
>   for all pvs {
> 
>     add events
>     if ( ++count > someNumber ) {
>       ca_pend_io( time )
>       count=0
>     }
> 
>   }
> 
>   ca_pend_io( time ) 
> 
> ====================================
> 
> 
> 
> This did not help at all. Then I change to code to
> 
> ====================================
> 
>   count=0
>   for all pvs {
> 
>     add events           
>     if ( ++count > someNumber ) {
>       ca_pend_io( time )
>       ca_pend_event( small-time )
>       count=0
>     }
>  
>   }
> 
>   ca_pend_io( time )
>   ca_pend_event( small-time )
> 
> ====================================
> 
> 
> 
> This made an amazing difference and now the performance is good all the
> time.
> 
> Is this behavior reasonable? Does pend event do something fundamentally
> different from pend io?
> 
> 
> John Sinclair
> [email protected]
> Oak Ridge National Lab
> 865-576-6362   865-574-1268 (fax)
> 


Replies:
RE: channel access john sinclair
References:
channel access john sinclair

Navigate by Date:
Prev: RE: Error message from sequencer Jeff Hill
Next: RE: channel access Coleman, Thomas A.
Index: 1994  1995  1996  1997  1998  1999  2000  <20012002  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: channel access john sinclair
Next: RE: channel access john sinclair
Index: 1994  1995  1996  1997  1998  1999  2000  <20012002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
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 ·