[ANN] LuaTask 1.6.1

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] LuaTask 1.6.1

Duck-2

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


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] LuaTask 1.6.1

Thomas Lauer-3
Duck <[hidden email]> wrote:
> > >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.

Okay. To spell it out in full, what I meant is this: a process linked
with the default linker switches will get 1 MB stack reserve for the
main thread. That's enough for many, if not most, apps, so most people
don't even think about that.

However, a reserved stack size of 1 MB per thread (by default, threads
inherit the stack allocation of the main thread) means that the 2 GB
address space fills up after ~1700 threads are created. To squeeze in
more, one can lower the reserved stack space, let's say to 256 KB. This
allows about four times as many threads than a 1 MB reserve would but
each individual stack is now four times smaller. And ...

> Obviously, a small stack may produce other problems.

I hope I am making myself clear now.

-- 
cheers  thomasl

web : http://thomaslauer.com/start


Reply | Threaded
Open this post in threaded view
|

Re: Luasys Win32

David Haley
In reply to this post by Rafael - SosCpdTerra
Sorry to hark on this, but to all people who do this: please don't start
new threads by hitting 'reply'. Thank you. :-)

Cheers,
- David

On this day of 07/03/07 13:39, SosCpdTerra saw fit to scribe:
> 
> Did someone have some more win32 specific instructions about build Luasys?
> Some place to have an example?
> 
> Thanks in advance.
> 
> Rafael
> 
> 


-- 
~David-Haley
http://david.the-haleys.org


Reply | Threaded
Open this post in threaded view
|

RES: Luasys Win32

Rafael - SosCpdTerra
ok

-----Mensagem original-----
De: [hidden email]
[[hidden email]] Em nome de David Haley
Enviada em: quarta-feira, 4 de julho de 2007 19:47
Para: Lua list
Assunto: Re: Luasys Win32


Sorry to hark on this, but to all people who do this: please don't start
new threads by hitting 'reply'. Thank you. :-)

Cheers,
- David

On this day of 07/03/07 13:39, SosCpdTerra saw fit to scribe:
> 
> Did someone have some more win32 specific instructions about build Luasys?
> Some place to have an example?
> 
> Thanks in advance.
> 
> Rafael
> 
> 


-- 
~David-Haley
http://david.the-haleys.org



__________ NOD32 2379 (20070704) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



12