On Fri, Sep 07, 2007 at 10:47:28AM +0200, Raimo Niskanen wrote: > We just discovered that it appears the default Posix thread > stack size is 64KByte for OpenBSD (4.1). That seems a bit slim. > To compare I recall Solaris8 has got 2MByte as default. > > Can I assume all C library routines in OpenBSD are tuned to be > careful with stack usage? > > Is there some system parameter to tweak to increase the default > stack size. It would be nice to not force the application > into setting its stack size - it differs a lot between > different platforms, would be hard to maintain and > has an uncomfortable stoneage feeling.
I usually have: #ifdef __OpenBSD__ size_t stacksize; pthread_attr_getstacksize(&attr, &stacksize); pthread_attr_setstacksize(&attr, stacksize * 2); #endif in my threaded stuff. Doubling the size usually works for my C++ stuff.