Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Depends on the app/framework but typically phantom threads don’t get started. Also, those stacks aren’t materialized until you write something - they’re all CoW’ed pages from a sentinel 0-filled page the kernel keeps around just for this purpose.


The stacks are allocated gradually, but there's a minimum few committed pages for each thread and there can be a lot of threads. The graphics driver alone will typically spawn a thread per CPU core unless you specifically disable threading optimizations, and that's separate from the thread pool.


It's been a while, but I believe Windows initialises an internal thread pool & parallelises (some parts of) process start / module loading


You’re right. I hadn’t realized that Windows creates a hidden thread pool under the hood for parallelized DLL loading.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: