Malfunction
Junior Contributor
Let's say I have an array containing about 1000 objects.
Now I need to perform an operation with each object.
Since this operation requires some I/O and webrequests I don't want to go through the array sequentially but parallel using threads.
Using four threads I would probalby double the speed of the application and using eight probably quadrupling it.
At a certain point adding more threats the application will become slower as the number of threads would use all cpu power.
Right now i would just do some trial and error to determine the right number for my machine. Other uer would probably have total different experience.
Another solution would be to give the user the oportunity to change the number of threads through a slider.
My question: Is there a more professional solution for balancing the number of generated threads?
Now I need to perform an operation with each object.
Since this operation requires some I/O and webrequests I don't want to go through the array sequentially but parallel using threads.
Using four threads I would probalby double the speed of the application and using eight probably quadrupling it.
At a certain point adding more threats the application will become slower as the number of threads would use all cpu power.
Right now i would just do some trial and error to determine the right number for my machine. Other uer would probably have total different experience.
Another solution would be to give the user the oportunity to change the number of threads through a slider.
My question: Is there a more professional solution for balancing the number of generated threads?