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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top