作者:啊咧咧咧咧咧咧咧列 | 来源:互联网 | 2023-05-17 11:45
Ihaveanarrayofarraysofint.我有一个int数组的数组。DataArray[X][Y]Iwouldliketocreateathreadf
I have an array of arrays of int.
我有一个int数组的数组。
DataArray[X][Y]
I would like to create a thread for each X, which iterates along Y. I cannot figure out how to pass the appropriate X value to each thread.
我想为每个X创建一个线程,它沿Y迭代。我无法弄清楚如何将适当的X值传递给每个线程。
essentially i would like to be able to do
基本上我希望能够做到
ExecutorService threadPool = Executors.newFixedThreadPool(10);
for (int i = 0; i
Any help would be appreciated
任何帮助,将不胜感激
2 个解决方案