Pooling shared resources

M

Maciej

Hi,

I want to develop a pool of shared resources: let's say auctioning
houses. Each auctioning house (which in fact is an active object) can
handle maximally X negotiations at once. And thus I've started to
design a pool with resources queued in a priority queue, where X is
maximum priority of the resource (i.e. auctioning house). The head of
the queue contains always resource with the highest priority (the
smallest number of actually handled negotiations) and everytime
resource is check-out from the pool, its priority gets decreased. When
the priority hits 0, resource is removed from the queue. Checking-in
resource to the pool works in exactly reverse way.

Is it the right model for this task ?
Do you any generic solutions for pooling with priorities ?
I mean not only ideas but also implementations in Java to learn on
examples ?

Regards,

Maciej
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top