EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: devSNMP: Thread error?
From: Andrew Johnson <[email protected]>
To: "Kagarmanov, Albert" <[email protected]>
Cc: "Bertrand H.J. Biritz" <[email protected]>, [email protected]
Date: Tue, 14 Nov 2006 09:58:26 -0600
Albert,

Kagarmanov, Albert wrote:
This is not a real error, it's warning from
pthread_attr_setstacksize system-call, which invoked in devSnmp.c in
function int epicsSnmpInit(int param)

Actually it is an error, in the epicsSnmpInit() code.


It looks like 10000 stack-size is small enough for your Linux (See
http://docs.sun.com/app/docs/doc/816-5137/6mba5vpja?a=view for detail)

We've changed this size till 128K as it recommended in
$EPICS/base/documentation/RELEASE_NOTES.html and don't have this
warning.
See our http://www-mks2.desy.de/content/e4/e40/e41/e12212/ for detail.

The stackSize parameter to the epicsThreadCreate() call should not be a number as the sizes needed can be different on different architectures. The epicsSnmpInit() function should be passing epicsThreadGetStackSize() one of three values epicsThreadStackSmall, epicsThreadStackMedium or epicsThreadStackBig according to how much stack the thread is expected to need, and using the return value from epicsThreadGetStackSize() as the parameter to epicsThreadCreate(). As an example, here's an excerpt from base/src/db/callback.c:


    callbackTaskId[ind] = epicsThreadCreate(taskName, priority,
        epicsThreadGetStackSize(epicsThreadStackBig),
        (EPICSTHREADFUNC)callbackTask, &priorityValue[ind]);

By using this approach, the problem should not arise in the future as a new architecture with a bigger or smaller stack requirement that gets added to Base can adjust the absolute amount of memory allocated to the three sizes.

My appologies if the wording in RELEASE_NOTES.html was confusing, and the Application Developers Guide entry for epicsThreadCreate() probably didn't help much either; I have just revised both documents.

- Andrew
--
There is considerable overlap between the intelligence of the smartest
bears and the dumbest tourists -- Yosemite National Park Ranger

Replies:
RE: devSNMP: Thread error? Kagarmanov, Albert
References:
RE: devSNMP: Thread error? Kagarmanov, Albert

Navigate by Date:
Prev: Re: Scaling Database entries Kay-Uwe Kasemir
Next: Re: Motion control failure at APS Bill Nolan
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: devSNMP: Thread error? Kagarmanov, Albert
Next: RE: devSNMP: Thread error? Kagarmanov, Albert
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·