-----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