EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: epicsThreadExitMain in softIoc program
From: Benjamin Franksen <[email protected]>
To: <[email protected]>
Date: Thu, 23 Jun 2011 23:24:16 +0200
Hi

I have finally found the reason why on linux in the sequencer 'make runtests'
occasionally hangs in between tests. The problem seems to be that my test
scripts start the program 'softIoc' from base with the -S option specifying
that it should not start an ioc shell (because it is supposed to run in the
background). In this case, the softIoc program calls epicsThreadExitMain. This
call turns the softIoc process into a zombie, which, occasionally, is also the
reason why such a process does no longer react to the usual signals except
SIGTERM (-9).

I think epicsThreadExitMain is supposed to save some resources; indeed,
without ioc shell the thread is no longer needed. However, since this seems to
have a lot of negative side effects, I propose to replace it with a simple
endless loop, something like

  while (1) {
    epicsThreadSleep(1.0);
  }

and to hell with the optimization.

I tried this, and it has *much* nicer behaviour: the process can be stopped
with Ctrl-C, it is no longer listed as zombie, and my runtests no longer hang
(on linux; the hangups on windows were caused by a bug in the sequencer that
have now fixed).

Cheers
Ben

________________________________

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführer: Prof. Dr. Anke Rita Kaysser-Pyzalla, Dr. Ulrich Breuer

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de


Navigate by Date:
Prev: Re: 64 bit integers (aka. long or long long) Andrew Johnson
Next: Mini-Codeathon at PSI Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: 64 bit integers (aka. long or long long) Benjamin Franksen
Next: Mini-Codeathon at PSI Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·