Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT: Servant Manager helpe needed

Status
Not open for further replies.

sansari

Programmer
Oct 16, 2003
5
0
0
US
Hi I'm kinda new with CORBA development.. I"m working on a project that i need help with. My client is invoking a certain method on a server object for 100 000 times. There are 1000 object refrences of this server object that have been created. Now the servant manager should make sure tehre are only 10 active servants in memory at any given point in time.. i'm wondering how to do that.. how should i change my servant manager to maintan only 10 servants at a tiem in memory.. and if more it should deactivate them
 
hi
First of all, the answer is to use the evictor pattern: a queue which keep alive only ten of the 1000 possible servant.
I did it, with c++, using the stl, if you are using java you could use hash, vector etc; it's not so difficult but vary depending on the kind of servant manager you use.
If i haven't misunderstood, you call always the same CORBA object,if so maybe you should use a default servant, the incarnation of multiple CORBA object is achieved with a unique servant, but it must not have any state.
For servant locators or activators: when the first servant is created must be registered in an hash table (size of 10 elements), once the table is full you choose the element to be deleted (less recently used, less frequently used, first in first out, etc depending on your application necessity),then you will create the next servant and will update the table.
Anyway for more practical example you can serch the web for "evictor pattern", or borrow "Advanced CORBA programming with C++" henning,vinosky in a library, it's very clear
Hope it helped
Vitellozzo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top