Windows 8.1中线程的最大最大线程数是多少? [英] What's the maximum number of threads possible for a threads in Windows 8.1?

查看:131
本文介绍了Windows 8.1中线程的最大最大线程数是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 8.1中可以生成的最大线程数是多少?哪些因素可以限制线程数?

What is the maximum number of threads that can be generated in Windows 8.1, and what factors can limit the number of threads?

推荐答案

与Windows中的大多数限制一样,这受可用内存的限制.当所有可用的虚拟内存都被线程堆栈(每个线程占用1 MB)占用时,一个32位进程会在2000个线程附近徘徊. 64位进程受提交分配所需的页面文件大小的限制.成千上万,这取决于分页文件可以增长多快来满足程序的需求.内核的分页内存池也有一个限制,每个线程都有一个内核堆栈,这样它就可以进行内核调用,通常每个线程24 KB.

Like most limits in Windows, this is limited by available memory. A 32-bit process keels over somewhat shy of 2000 threads when all available virtual memory is occupied by the stacks of the threads (1 MB each). A 64-bit process is limited by the size of the paging file, needed to commit the allocation. Many thousands, it depends on how fast the paging file can grow to meet the needs of the program. There is also a limit imposed by the kernel's paged memory pool, each thread has a kernel stack so that it can make kernel calls, typically 24 KB per thread.

这些限制远远超出了程序员可以在空中保持的球数而又不会丢下脚的范围.他将徘徊很长时间,线程错误非常难以解决.

These limits are far beyond the number of balls a programmer can keep in the air without dropping one on his foot. He'll be limping around for a long time, threading bugs are exceedingly hard to troubleshoot.

Mark Russinovich探索了此优秀博客文章中的限制.

Mark Russinovich explores the limits in this excellent blog post.

这篇关于Windows 8.1中线程的最大最大线程数是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆