4 ms·
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
by vlovich123 2mo ago
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.
- dwattttt 2mo agoIt's been a while, but I believe Windows initialises an internal thread pool & parallelises (some parts of) process start / module loading
- vlovich123 2mo agoYou’re right. I hadn’t realized that Windows creates a hidden thread pool under the hood for parallelized DLL loading.
- ack_complete 2mo agoThe 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.