We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Accessing pooled object from web application

dees asked
Medium Priority
Last Modified: 2010-04-16
Dear Friends
   I need guidance for below problem
 A win app which should instantiates say 5 object in an ary.And a web application residing in the same machine should access the objects from the memory.when 'user A' logsin the web app should search for  available free object(out of 5) from the memory and that object must be locked until unless 'user A' logsout in between if 'user B' logsin it should search for free object(out of 4) .At a time 5 user should access 5 differrnt object  
thanks in advane

Watch Question

use constucter of that class and with the help of  variable you can keep track of those object
There are lots of ways to implement a pool, but the real problem is sharing the objects between two different applications on the same machine. I have to say I don't know a simple way of doing that.

One solution (not simple) will be to implement a Remoting service on IIS. This will host the pool as a Singleton object (an object of which there can only ever be a single instance of in a given application space). Your pool will be a collection of the objects that you want to pool. Each of these will be stored along with a flag that indicates if they are free or not. You will also need to implement some kind of pool manager that will maintain the pool and solve problems such as permanently checked-out objects caused by application crashes etc.

This is not a simple problem, and therefore it won't have a simple solution, but with a little persistence you will be able to pull it all together. I couldn't find many good background articles, so I would first read up on what a singleton design pattern is:

Then have a look at this for an idea of one method for implementing a singleton in .NET on IIS:

If you think you can do all that, then you need to design your pool. You can use System.Collections.CollectionBase as the base of the collection that will hold you pooled objects, but you will need to do something along the lines of storing a wrapper class that will also store attributes such as CheckedOut, TimeOfCheckOut, UserWhoCheckedOut etc. Finally you need to decide on your pool management strategy, and design a timer-based class that is created with the pool and that looks after the pool.


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.