lua-users home
lua-l archive

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



>Obviously, a small stack may produce other
>problems.

IIRC Windows will extend the stack of any thread

It is quite feasible to have 1500 threads with most of them
using no or almost no committed memory because they sleep.

But all these threads still need their share of reserved memory.

Indeed...my point is just that IIRC, your concern that "a small stack may produce other problems" shouldn't be an issue _under Windows_ like it is under pthreads because thread stacks grow as needed.

So if you start your 1500 threads with 256k each, you'll commit a lot less memory up front. If some of them need more stack they'll just get given it at run-time, unlike with pthreads, where the initial committed size is both the minimum and the maximum allocated to the thread.