程序并非总能终止?多线程测试场景下的技术咨询
我正为个人项目测试多线程功能,同时尝试开发异常应对方案,于是写了如下测试代码:
public class main { static int addToCounter; static int addToErrorCounter; public static void main(String[] args) throws InterruptedException { int threads = 10; Executor exec = new Executor(); for (int i = 0; i < threads; i++) { double error = Math.random(); testClass aldo = new testClass(); Thread thread = aldo.getThread(300, error); exec... } } }
内容的提问来源于stack exchange,提问作者user9549355
相关产品推荐
相关产品推荐

