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  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 
<== Date ==> <== Thread ==>

Subject: question about ca_get, ca_pend_io timeout in EPICS client with Windows XP multi-threading
From: Jay Steele <jsteele@xradia.com>
To: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Mon, 15 Aug 2011 15:23:08 -0700

Hi EPICS folks,

        I have some questions regarding an EPICS client and multi-threading on WINDOWS. Let me start by

laying out the development environment.

 

       I am developing an interface to an EPICS motor record using the CA API.

I am using base 3.14.8.2. I am compiling under Windows XP using Visual Studio

2008. I have successfully compiled all necessary components this way. I

know that there are no issues with the compiling because all of the

utilities and executables generated by the base are functional. My interface is

being generated in a GUI application for Windows XP. When I

start the program, the main process thread instantiates a class which

contains all of my EPICS related code. This class will connect to the

various PVs I require and store their chid objects for future access.

 

       For initialization, I call these functions from the main task.

 

int nRet = ca_context_create(ca_enable_preemptive_callback);

m_pEPICSContext = ca_current_context();

 

       I then go on to do other necessary steps for my program and eventually I

complete startup. Once startup has completed, there is a spawned thread

which will go to my EPICS class at a specified interval and retrieve new

data from the EPICS motors. This thread is priority THREAD_PRIORITY_ABOVE_NORMAL, is attached

to the main task’s context using ca_attach_context(m_pEPICSContext),

and periodically calls ca_get, then ca_pend_io to retrieve the motor data. I use

a 5 second timeout value for ca_pend_io. This normally works to successfully retrieve the motor data.

 

               However, when I launch another thread at priority THREAD_PRIORITY_ABOVE_NORMAL, and this thread keeps the CPU busy,

then for some reason the ca_pend_io function returns with timeout

(User specified timeout on IO operation expired). The WINDOWS O/S appears to swap CPU time between the two ABOVE_NORMAL priority threads,

But the ca_pend_io function still time outs. Is this expected behavior? Does the low level functionality in ca_pend_io run at a

low priority, so that it will timeout? Would the ca_get_callback function work better for this situation?

 

Thanks,

Jay Steele

Xradia Corporation



The information in this email, including any attachments, is confidential and intended only for the recipient(s) listed. Any use of this email for any other purpose is prohibited. If you have received this email in error, please notify me immediately by reply email, delete this email, and do not disclose its contents to anyone.

Replies:
RE: question about ca_get, ca_pend_io timeout in EPICS client with Windows XP multi-threading Jeff Hill

Navigate by Date:
Prev: Re: EPICS Collaboration Meeting Fall 2011, Final Call Andrew Johnson
Next: RE: question about ca_get, ca_pend_io timeout in EPICS client with Windows XP multi-threading 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 
Navigate by Thread:
Prev: Can vmic3123 use triggers to start and stop the acquisition? Ma Xiaoyuan
Next: RE: question about ca_get, ca_pend_io timeout in EPICS client with Windows XP multi-threading 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 
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 ·