EPICS Home

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  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: Re: How to safely implement an asynPortDriver with SCAN records
From: Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
To: Jure Varlec <jure.varlec at cosylab.com>
Cc: Érico Nogueira Rolim <erico.rolim at lnls.br>, tech-talk <tech-talk at aps.anl.gov>
Date: Wed, 20 Jul 2022 14:43:25 -0700
On 7/20/22 11:51, Jure Varlec wrote:
 > imo. it is reasonable to join worker threads here, but I would
recommend against deleting.

Please keep in mind that delete leaves dangling pointers in the
asyn port.  imo. this is an invitation for the chaos of
use-after-free errors.

Could be, but I can't see how.

Ah, some Famous Last Words :)


The IOC is shutting down, asynManager is rejecting queueRequest calls to a disabled port

Which could be re-enabled.  And assuming that all code
actually respects the enabled switch.


(which is what the device support code uses), and asyn doesn't register any hooks that I can see.

Currently.


So AFAICT, when the records are the only users of the port, there should be no chaos.

As far as has been said, no.  This is an assumption through.

Actually, I should have mentioned before now the "atExitDebug"
global, which logs each exit hook before it runs.  I added this
after once being surprised by an exit hook I didn't know about.

var atExitDebug 1


Are you just trying to be careful,

In short, yes.

I'm trying to be careful and encourage what I see a good practice.
I certainly don't intend to jump on you in particular.

Tech-talk is an archived public mailing frequented by new(er)
users.  So in addition to Érico, I'm conscious of the audience.
Both now, and those whom google will later bring.


or are you aware of something I missed? If I'm wrong about this, I'd love to know before I have to face the chaos :) .

Best,
Jure


Replies:
Re: How to safely implement an asynPortDriver with SCAN records Jure Varlec via Tech-talk
References:
How to safely implement an asynPortDriver with SCAN records Érico Nogueira Rolim via Tech-talk
RE: How to safely implement an asynPortDriver with SCAN records Mark Rivers via Tech-talk
Re: How to safely implement an asynPortDriver with SCAN records Érico Nogueira Rolim via Tech-talk
Re: How to safely implement an asynPortDriver with SCAN records Andrew Johnson via Tech-talk
RE: How to safely implement an asynPortDriver with SCAN records Mark Rivers via Tech-talk
Re: How to safely implement an asynPortDriver with SCAN records Michael Davidsaver via Tech-talk
Re: How to safely implement an asynPortDriver with SCAN records Érico Nogueira Rolim via Tech-talk
Re: How to safely implement an asynPortDriver with SCAN records Jure Varlec via Tech-talk
Re: How to safely implement an asynPortDriver with SCAN records Michael Davidsaver via Tech-talk
Re: How to safely implement an asynPortDriver with SCAN records Jure Varlec via Tech-talk

Navigate by Date:
Prev: Re: Automatically populating the Archive Appliance Han Lee via Tech-talk
Next: Re: How to safely implement an asynPortDriver with SCAN records Jure Varlec via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
Navigate by Thread:
Prev: Re: How to safely implement an asynPortDriver with SCAN records Jure Varlec via Tech-talk
Next: Re: How to safely implement an asynPortDriver with SCAN records Jure Varlec via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024