2002 2003 2004 2005 <2006> 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 2002 2003 2004 2005 <2006> 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: A question about how to send message in the callback function |
From: | "Jeff Hill" <[email protected]> |
To: | 'ÕÔ»¶' <[email protected]>, <[email protected]> |
Date: | Mon, 27 Mar 2006 08:26:40 -0700 |
Hello ZHAO HUAN,
One must call ca_attach_context from the satellite thread after calling ca_current_context in the main (CA client context initiating) thread. Also see “CA Client Contexts and Application Specific Auxiliary Threads” in the CA Reference Manual. Also see “Thread Safety and Preemptive Callback to User Code”.
PS: If you enable preemptive callback be careful to protect your data structures against simultaneous use from multiple threads.
Jeff
-----Original Message-----
Dear everybody: I am a novice to EPICS. I want to develop a simple application which will have functions of put,get and monitor channels in IOC. I have installed EPICS Base R Now, I face a puzzle. I cteate a auxiliary thread. And in the auxiliary thread, I do an operation of create a monitor(ca_create_subscription). Then in the monitor’s callback faction, I make an operation of sendmessage. The problem is coming. The runing programe is dead at the sendmessage step. If somebody have the experience, tell me what is wrong in my application, and how can I resolve it. Thanks ZHAO HUAN Shanghai Institute of Applied Physics Tel: +86-21-59553146
|