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  <20082009  2010  2011  2012  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  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: EPICS Threading Issues
From: Andrew Johnson <[email protected]>
To: [email protected]
Date: Tue, 21 Oct 2008 18:11:39 -0500
Hi Richard,

On Tuesday 21 October 2008 17:25:48 Richard Pastrick wrote:
>
> If I issue a ca_get right after I create the channels in the same thread
> that created the channels, I will receive the proper value of 2.5. I can
> also use ca_put with no problem. So if I issue a command to move to 4.2
> from my program, the motor actually will move to this new location but the
> ca_get to retrieve the RBV will return 0 for the read value.
>
> So my question boils down to this, should EPICS be able use a channel that
> was created in a different thread?

Yes, if you code it properly.  If you want to call the CA library from 
different threads but using a single context like that, you need to attach to 
the same CA context in all of them.  Have a look at 
http://www.aps.anl.gov/epics/base/R3-14/8-docs/CAref.html#Client2
for information about attaching your secondary thread to the first thread's CA 
context.  Once you do that, your code should work properly (assuming you're 
handling thread synchronization properly).

Don't be afraid to ask additional questions on this list, that's what we're 
here for.

- Andrew
-- 
Talk is cheap. Show me the code. -- Linus Torvalds

References:
EPICS Threading Issues Richard Pastrick

Navigate by Date:
Prev: EPICS Threading Issues Richard Pastrick
Next: RE: EPICS Threading Issues Jeff Hill
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: EPICS Threading Issues Richard Pastrick
Next: RE: EPICS Threading Issues Jeff Hill
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·