Maintain the FIFO order of execution of task in thread executor pool

1.1k Views Asked by At

My application is executing the task alloted to it by the other application.For every ten tasks execution application put the progress information in the database. I am using thread executor pool to put the updated information in the database. The problem is that request are not executed in FIFO order in thread pool. For ex:
FirstRequest :- 10 tasks are executed, so request to store value = 10 is sent to thread pool.
SecondRequest:- Another 10 tasks are executed, request to store value = 20 is sent to thread pool.

The problem arises when second request is executed before first request.
Is there anything i can do with thread pool to maintain the FIFO order ?

0

There are 0 best solutions below