EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: How to ensure epicsThread function is running in short-lived environment?
From: Benjamin Franksen via Core-talk <[email protected]>
To: "[email protected]" <[email protected]>
Date: Thu, 4 Apr 2019 14:20:51 +0200
Am 03.04.19 um 18:31 schrieb Michael Davidsaver via Core-talk:
> On 4/2/19 2:35 PM, Konrad, Martin via Core-talk wrote:
>> I have a bunch of unit tests for support modules that spawn epicsThreads
>> and tear them down after a very short time. I noticed that although I'm
>> waiting for the thread to shut down cleanly tests are not reproducible.
>> In the attached simple code snipped I sometimes see the thread function
>> running:
> 
> In situations like this I use an epicsEvent, and trigger it at
> the start of run().  The main thread would then wait on this
> event to detect actual thread start.

This is clearly the one appropriate solution to the problem. More
generally one could use a message queue e.g. if the supervisor thread
wants to monitor the state of several "client" threads. This could be
enhanced to transfer other state information, e.g. sending messages to
indicate startup and shutdown of a thread etc etc

Cheers
Ben

Attachment: signature.asc
Description: OpenPGP digital signature


References:
How to ensure epicsThread function is running in short-lived environment? Konrad, Martin via Core-talk
Re: How to ensure epicsThread function is running in short-lived environment? Michael Davidsaver via Core-talk

Navigate by Date:
Prev: Re: Excessive scan times for periodic scans Konrad, Martin via Core-talk
Next: Re: EPICS 7.0.2.1 release preparation Dirk Zimoch via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: How to ensure epicsThread function is running in short-lived environment? Michael Davidsaver via Core-talk
Next: Re: [Merge] ~bhill/epics-base:pvAccess-envDefs.h into epics-base:7.0 Bruce Hill via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 04 Apr 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·