• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

.NET machine wide object

ASB

Godlike
Joined
Jul 6, 2005
Messages
5,480
Likes received
210
Thanks received
91
Location
Somerset
I could do with being able to create a single instance of a .NET object which is visible to any .NET process on a machine.

The basic problem being that I have different clients which require exclusive use of a number of resources. I can detect that the resource is in use if a second client is started but this is a bit late, would rather be able to do it at start time.

Any suggestions/examples ?

Obviously it's simple enough to create a mutex or similar which is what I have done in the past, but I would like to associate some data with the object to share between some other processes.

Don't want remoting, but may have to.

Also, stuck at .NET 2.0
 
Without understanding the background of your request any further I'd suggest that perhaps the object should be serialisable and stored in the database? That way you have safe / concurrent access to the same object and can wrap a proper transaction around the CRUD actions on it.

If you consider session state in a web farm scenario it's the same. You end up using SQL Server for the most part to handle to the out of proc requirements for sharing access to the session object.
 

Advertisers

Back
Top