java - How to parallelize without threads? -


I am developing an application with game framework that performs intensive CPU counts. These calculations are written in 40 pieces, which have to be run in parallel. Now I have acted as a singer for each of these calculations, and when the calculation is requested, 40 new artist starts. My problem is that in the application front I am running a polling service to check whether the calculation has expired, and due to the execution of so many threads, the CPU gets 100% voting and, of course, The entire navigation remains up to 20 seconds, and it is a trivial request that in normal circumstances it lasts less than 1 second.

I'm running it in an OWS small example, with just one core. This is part of the problem, but I need to make sure that when the application is in production and the traffic is very large, the "backend" calculation will not affect the front experience.

To normalize the dispatcher "size" for the general approach with Akka, to process the front threads for lower threads and then free cpu, but I need at least 40 parallel processing elements I tried to reduce the preference with these calculated threads to:

  threads WrenchTrad () SetPriority (Thread.MIN_PRIORITY);  

But I do not see any effect in performance. My main question is, is there any way I can parallel these executions, but not many threads? can?

"post-text" itemprop = "text">

My opinion:

It seems that there is no easy way to solve a parallel problem, so the whole idea To separate your previous service with reckoning.

First of all, WebSocket. Run the WebSocket service on your backend server, and connect to that web site with the frontend. Does not vote on the front server, but the back server removes the result when calculation is done.

Secondly, run Front Service on another example, even on most client browsers, using the modern JavaScript framework, such as Angulios.

Therefore, the slow performance back count will not affect further performance, and whenever it is done, you can get front results (WebSketak).


Comments