EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: dynamic monitoring
From: Patrick Thomas <[email protected]>
To: Jeff Hill <[email protected]>
Cc: [email protected]
Date: Fri, 21 Jan 2011 17:38:16 -0800
Do you mean calling ca_pend_event(0) in the main program, and subscribing/unsubscribing in a separate thread? Is there an advantage to this?

On 1/21/2011 5:34 PM, Jeff Hill wrote:
Hi Patrick,

The mechanism to start/stop a subscription is accessed via calls to
ca_create_subscription/ca_clear_susbscription. If you have a single threaded
application then you will need to start and stop the subscriptions from
within the main loop. Therefore, yes, that could be accomplished by calling
ca_pend_event with a finite timeout, deciding what subscriptions might be
needed, and calling ca_create_subscription/ca_clear_susbscription to start
stop the appropriate subscriptions - all of these actions in a loop. There
are of course many other, more complex, ways to schedule this including
changing to a preemptive callback mode application with multiple threads
(emphasis on complex) but of course a simple, minimal approach is often
just-a-fit for the design requirements.

Jeff
______________________________________________________
Jeffrey O. Hill           Email        [email protected]
LANL MS H820              Voice        505 665 1831
Los Alamos NM 87545 USA   FAX          505 665 5107

Message content: TSPA

With sufficient thrust, pigs fly just fine. However, this is
not necessarily a good idea. It is hard to be sure where they
are going to land, and it could be dangerous sitting under them
as they fly overhead. -- RFC 1925


-----Original Message-----
From: [email protected] [mailto:tech-talk-
[email protected]] On Behalf Of Patrick Thomas
Sent: Friday, January 21, 2011 6:01 PM
To: [email protected]
Subject: dynamic monitoring

Hi,

I was wondering what the best way is to dynamically monitor channels in
C. That is to start and stop monitoring channels at run time. I
currently have a program that connects to and attaches monitors to a
predefined list of channels and then goes into a ca_pend_event(0), which
blocks forever. Should I change this to a loop and specify a certain
time period, i.e. ca_pend_event(1) and add or remove channels in that
loop?

Thank you for your time,
Patrick


Replies:
RE: dynamic monitoring Jeff Hill
References:
dynamic monitoring Patrick Thomas
RE: dynamic monitoring Jeff Hill

Navigate by Date:
Prev: RE: dynamic monitoring Jeff Hill
Next: gensub to asub emmanuel_mayssat
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: dynamic monitoring Jeff Hill
Next: RE: dynamic monitoring Jeff Hill
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·