本文介绍了cpu如何处理多个线程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
正在制作一个使用snmp来发现子网上的设备的程序.我的程序在子网上找到所有IP地址,并向每个IP发送一个snmp get请求.我正在使用多个线程,我想知道:
如果我不限制线程数,并且线程数超出了cpu所能处理的范围,它会等待启动一个线程直到一个线程关闭还是完全不启动?
Ia m making a program that uses snmp to discover devices on a subnet. My program finds all ip addresses on the subnet and sends an snmp get request to each ip. I am using multiple threads and I am wondering:
If I don''t limit the number of threads and there are more threads going than the cpu can handle how does the cpu deal with that, Does it wait to start a thread until one closes or do they just not get started at all?
推荐答案
这篇关于cpu如何处理多个线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!