News for hackers. Stuff that matters.
Re:The future of M:N threading by limsup on Wednesday November 13, 2013 @12:40PM (#6726849)
If you restrict yourself to 64 bit systems, you can essentially go back to using OS threads with blocking I/O because the address space is so large. You can fit thousands of 2MB call stacks into the processes address space and rely on the OS and MMU to manage the memory.

The problem that created the whole non-blocking, async domain was the memory needed for the thread's call stacks. You don't have enough address space to place a bunch of 2MB call stacks for each thread, if you're handling tens of thousands of connections.

Re:The future of M:N threading by masklinn on Wednesday November 13, 2013 @01:15PM (#6727106)
> The problem that created the whole non-blocking, async domain was the memory needed for the thread's call stacks. You don't have enough address space to place a bunch of 2MB call stacks for each thread, if you're handling tens of thousands of connections.

c10k is (almost) 15 years old, updating it for today are the OS and MMU going to manage 10 million threads and stacks for that many connections?

Re:The future of M:N threading by rdtsc on Wednesday November 13, 2013 @02:18PM (#6727647)
2MB call stacks?

Mine are 10MB:

    $ ulimit -s
    $ 10240

I can only spawn 200 threads in the worst case and keep them active before system starts swapping. Yes memory space is large by anytime those have to run they'd have to be brought up into the working set.

EDIT: nevermind, _wmd pointed out that stack memory is still virtual and it only be brought into the physical memory as needed.

Re:The future of M:N threading by MrBuddyCasino on Wednesday November 13, 2013 @03:10PM (#6728113)
Now I'm confused. This comment says that the stack memory is not allocated by the OS unless actually needed: https://news.ycombinator.com/item?id=6728030

Is this not true?

Re:The future of M:N threading by rdtsc on Wednesday November 13, 2013 @03:14PM (#6728140)
That is right, the full 8MB or 10MB or whatever of max is not being paged in.

I am stupid. I'll correct the initial comment.

Thanks