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
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