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: [Merge] ~epics-core/epics-base/+git/Com:thread-join into epics-base:7.0
From: mdavidsaver via Core-talk <[email protected]>
To: mdavidsaver <[email protected]>
Date: Sun, 23 Jun 2019 23:04:18 -0000
Maybe I'm not understanding.  What is the lifetime of the handle returned by taskSpawn()?  Will it ever be free()'d?  Will it ever be reused?  eg. Will a second call to taskSpawn() ever return the same ID?

My assumption is that IDs are not free()d, and can be reused (like a file descriptor).  If this is the case, then it is possible for a race to occur between the time I get hold of an epicsThreadId, and the time I call epicsThreadMustJoin() on it.  If in this interval the original thread exits, and suppose a new thread is started which happens to get the same ID.  In this case I end up trying to join a different thread!

Resolving this is what necessitates joinable vs. detached as user configuration.  Either the handle should remain valid, for the same thread, until joined.  Or it should be freed  immediately when the thread returns.

So the fact that the vxWorks epicsThreadCreateOpt() does nothing with epicsThreadOpts::joinable tells me that there is a bug.

-- 
https://code.launchpad.net/~epics-core/epics-base/+git/Com/+merge/361379
Your team EPICS Core Developers is subscribed to branch epics-base:7.0.

Navigate by Date:
Prev: [Bug 608956] Re: vxWorks 6.8 deprecates the use of taskVarLib Andrew Johnson via Core-talk
Next: Re: [Merge] ~epics-core/epics-base/+git/asLib:as-hostname into epics-base:7.0 mdavidsaver 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: [Merge] ~epics-core/epics-base/+git/Com:thread-join into epics-base:7.0 Andrew Johnson via Core-talk
Next: Re: [Merge] ~epics-core/epics-base/+git/Com:thread-join into epics-base:7.0 mdavidsaver 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, 23 Jun 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·