Forum Stats

  • 3,768,563 Users
  • 2,252,811 Discussions
  • 7,874,623 Comments

Discussions

Allocate particular request to difinite processors through java code

rahulsri71
rahulsri71 Member Posts: 22
edited Dec 7, 2017 7:31PM in Java User Groups Discussions

Hi team,

i have one query related to java , As i have got two services which is calling a method  parallely , i want that when my one service on which load is more is running it should serve normally, but if the request comes from the second service it should start processing the request of that service , i mean the threads in service one should not be lost can i achieve this using java 8 .

one solution that i thought was that i can make a thread pool of 100 threads and allocate 80  threads to service one and another 20 to other service, but i had one issue in this that suppose my all 80 threads are in use by service one then i will not have processors to process the request coming from second service,

please do provide solution to this question as we need this, if its in java 8 it would be better

Answers