[Asterisk-bsd] Stack size in pthreads

Konstantin Prokazoff asterisk-bsd@lists.digium.com
Tue, 20 Jul 2004 17:55:43 +0300


Welcome!

    Our patches are ready (.diff), which adds required code for *BSD and do
nothing for linux.
    Still testing, amount of .diff = about 15 (all channels, applications
and asterisk core).
    Now, we trying to resolve scheduling problems in *BSD (debug output
about bad UDP packets).
    I can (will) post .diff's today, which are resolves stack size problem.
    Sorry, I can't test requirements in stack resizing on other *BSDs, can
anyone check?
Simplest code are (simple.c):

#include <stdio.h>
#include <pthread.h>

int main() {
    pthread_attr_t    attr;
    size_t                stacksize;
    pthread_attr_init(&attr);
    pthread_attr_getstacksize(&attr, &stacksize);
    printf("Default stack size for thread: %u\n", stacksize);
    return 0;
}

BR,
    Oryx.
----- Original Message -----
From: "Olle E. Johansson" <oej@edvina.net>
To: <asterisk-bsd@lists.digium.com>
Sent: Tuesday, July 20, 2004 5:36 PM
Subject: [Asterisk-bsd] Stack size in pthreads


> http://bugs.digium.com/bug_view_page.php?bug_id=0002067
>
> Seems like the default stack size for a native thread in FreeBSD is 64k,
> which is not enough for Asterisk. We need to make it higher.
>
> Questions:
> * In how many places of the source do we need to set the thread stacksize?
>
> * Is this needed for other BSD:s as well? What about Mac OS/X?
>
> Again, this is beyond my knowledge of programming, so we need help in
> coming through here. Raising the stack size made my crashes disappear.
>
> Join me in the bug tracker, now :-)
>
> And thank you Oryx, for a great job in providing us with fixes and
information.
>
> /O
> _______________________________________________
> Asterisk-BSD mailing list
> Asterisk-BSD@lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-bsd
>