[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] pthread_attr_setstack() limitation



Hi Falk,

Brettschneider Falk wrote:

> as I was playing around to use an 8KB SRAM as stack via
> pthread_attr_setstack() I saw there's a strange stacksize limitation in the
> pthread lib. I removed that locally, because a global search doesn't show a
> explanation that makes sense to me. Could it be changed in the official CVS
> tree as well? See the patch below.

I might be missing something here, but allowing zero sized stacks sounds
like a recipe for disaster, particularly on a noMMU system.  The first
function call or local variable allocation made by a thread will start
trashing memory.  Whether the limit should be 16kb, or 8kb, or 4, or
whatever, is debatable, but zero seems like a bad idea?

Custom stacks setup via pthread_attr_setstack () can be any size you
like - the library is assuming you know what you are doing in that case.

John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/