jeudi 15 avril 2021

Java 8 concurrent queue of semaphores

I need to make a queue with n semaphores so processes that did not enter due to size, stand in the waiting pool until the queue is free. When process have semaphore, ThreadPool runs its function in another thread. I also need a concurrent list of semaphore-carrying processes' IDs so that it is updated along with the semaphore queue. How can I do this using modern Java 8 patterns?

Aucun commentaire:

Enregistrer un commentaire