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

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -