multithreading - Implementing multiple queue and single thread in Java -
using java need implement following architecture: there multiple queues jobs continuously coming in queues. there single thread picking jobs queues following scheduling algorithm. should able write own scheduling algorithm. can please tell me java api use implement this? have used threadpoolexecutor, implement single job queue , thread pool containing multiple threads. in advance!
use multiple concurrent queues , 1 semaphore. in producers, push objects , signal semaphore. in 1 consumer, wait on 'common' semaphore , poll queues according scheduling algorithm - 1 of them must have object on it.
Comments
Post a Comment