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: "Bertrand H.J. Biritz" <[email protected]>
To: [email protected]
Date: Tue, 14 Nov 2006 12:38:56 -0800
Hi Albert,

thank you very much for the updated devSNMP :)

I compiled it and the IOC works - although I need to use "make clean uninstall install", or else I get a segmentation fault when loading the db.

Bertrand


On Nov 14, 2006, at 9:32 AM, Kagarmanov, Albert wrote:


Hi Andrew,
Yes, it's clear that using
epicsThreadGetStackSize(epicsThreadStackBig) is much more universal than
pure constants as 10000 or 132096.
Small constant can cause warning (like we at DESY had before in our
SL2.6/R3.14.7.2, when we used stackSize=10000) or even error (like you
wrote).
Thank you for advice!
I've already re-compile, test and add this your changing in our
DESY devSNMP download page
(http://www-mks2.desy.de/content/e4/e40/e41/e12212/)


Best regards,
Albert

-----Original Message-----
From: Andrew Johnson [mailto:[email protected]]
Sent: Tuesday, November 14, 2006 4:58 PM
To: Kagarmanov, Albert
Cc: Bertrand H.J. Biritz; [email protected]
Subject: Re: devSNMP: Thread error?


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



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

Navigate by Date:
Prev: Re: Modbus driver David Dudley
Next: Irmis applicative points Lecorche Eric
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: devSNMP: Thread error? Bertrand H.J. Biritz
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 ·