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

Subject: Re: epicsThread
From: Dirk Zimoch <[email protected]>
To: [email protected]
Date: Mon, 26 Aug 2013 17:25:59 +0200
On 26.08.2013 16:22, Michael Davidsaver wrote:
One mechanism for accomplishing what you ask is a delayed callback based
on a timer. When coupled with asynchronous records (what the asyn module
is based on) this gives a way to have long delays in record processing
without locking everything up.

That's actually what StreamDevice is doing when it finds a 'wait' command in the protocol.

See http://epics.web.psi.ch/software/streamdevice

Dirk



For an example see

https://pubweb.bnl.gov/~mdavidsaver/epics-doc/epics-devsup.html#_asynchronous_example


Michael

On 08/26/2013 04:18 AM, Vikram Bhagat wrote:
Dear all,
I want to know how to create and handle EPICS thread at run time.
In my application, i am using serial communication. I am
reading/writing data from serial port.
I am using Asyn driver.

In my application i have added one more functionality (asyn reason) to
wait for user-define time and then complete record processing.
In this function caput <PV name> with time in seconds will wait for
that much seconds (I put one loop to read system time and check that
user-defined time has been reached or not) and then "return asynSuccess".

This is working fine but problem now is-> the system is not processing
any other record/PV till the delay time will complete. Means if i user
requested delay time for 5 minutes--> the system will not process
other reading or writing PV till 5 minutes complete.

How i can handle this situation? while system is waiting for time
delay other record needs to be processed and have to give values or
write to the output.

I think i have to create epicsThread for this delay. so it will run in
separate thread and other functions can work independently. But in my
case after completion of my delay i have to delete Thread ... How i
can delete that Thread and make sure that my asyn driver will return
asynSuccess for that delay function?

Thanks & regards
Vikram




References:
epicsThread Vikram Bhagat
Re: epicsThread Michael Davidsaver

Navigate by Date:
Prev: Re: epicsThread Michael Davidsaver
Next: StreamDevice communication problems Tito Körner
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: epicsThread Michael Davidsaver
Next: Re: epicsThread Vikram Bhagat
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·