How to add two arrays in Java in parallel manner? -
for example, there 2 huge (length 2-3 million) of array float [] or double []. need them add up. how it? there libraries this?
employ fixed thread-pool number of threads equaling number of processor cores. submit many tasks there threads. each task receives index range needs sum. in main thread collect results futures returned executorservice.submit , sum them final result.
Comments
Post a Comment