Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #16 (permalink)  
Old 12-13-2006
bpolivka bpolivka is offline
Registered User
 
Name: Brett Polivka
Organization: Magnetar Capital
Project: Financial Core Services
 
Join Date: Feb 2006
Posts: 15
The advantage of having a Dispose() method would be that there are a lot of component management frameworks that can take advantage of IDisposable objects.

As I mentioned above, our libraries don't expose Ice directly to the client applications. Many of the apps were initially built as fat clients, and are being migrated to a service-based architecture, so we are trying to integrate Ice with as little impact on the clients as possible. One way we have achived this is by using a component container such as the Windsor MicroKernel (www.castleproject.org) to allow different subsystems to create and register components in a container which is under the application's control. The application doesn't know what is in the container. It just knows that before it exits, it has to Dispose() of the container, which in turn will Dispose() of any IDisposable objects inside of itself. Each of these libraries that uses Ice retrieves its Communicator from the container (the container can be configured to create it on first request), and the Communicator gets destroyed when the app Dispose()s of the container.

However, due to the fact that Communicator doesn't implement IDisposable, it can't directly take advantage of this. We have to wrap it in a thin wrapper class that does implement IDisposable, which in turn calls calls destroy(). If Communicator implement IDisposable directly, we wouldn't need this wrapper class.

The lack of IDisposable is far from a showstopper and not a big deal at all. It is just a very minor inconvenience.

Thanks,
Brett
__________________
Brett Polivka
Core Financial Systems
Magnetar Capital LLC
Reply With Quote
  #17 (permalink)  
Old 12-13-2006
bpolivka bpolivka is offline
Registered User
 
Name: Brett Polivka
Organization: Magnetar Capital
Project: Financial Core Services
 
Join Date: Feb 2006
Posts: 15
Quote:
Originally Posted by rdilipk View Post
"Oops, yes, you are right. It's not clear to me what adding a Dispose() method would achieve then though. In effect, it would just be an alias for Communicator.destroy(). Who would call the Dispose() method (if not the application)? Or, to put it differently, if the application doesn't call destroy(), would it be any more likely to call Dispose?"

Even the application forgets to call Dispose, the communicator's finalizer code will call Dispose() subject to some boolean checks.
Only if the finalizer was coded to call Dispose(), which is not a requirement.
__________________
Brett Polivka
Core Financial Systems
Magnetar Capital LLC
Reply With Quote
  #18 (permalink)  
Old 12-14-2006
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 931
On balance, I think that adding a Dispose() to the communicator isn't worth it. Because much of the Communicator code is generated from Slice, the only way to add this would be to add another metadata directive. And the payback for the effort is too small to make this worthwhile, I think. As you say, it's easy enough to create a wrapper class for those application that want to hide the Ice run time entirely.

Cheers,

Michi.
Reply With Quote
  #19 (permalink)  
Old 12-14-2006
bpolivka bpolivka is offline
Registered User
 
Name: Brett Polivka
Organization: Magnetar Capital
Project: Financial Core Services
 
Join Date: Feb 2006
Posts: 15
I hadn't thought about the fact that the Communicator was generated from Slice. I totally agree that it's not worth adding a metadata directive just to get this feature.

Thanks for all of your time,
Brett
__________________
Brett Polivka
Core Financial Systems
Magnetar Capital LLC
Reply With Quote
  #20 (permalink)  
Old 01-31-2007
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 931
For Ice for C#/VB 3.2, the Ice run time threads will be created as background threads.

Cheers,

Michi.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Threads and Shutdown acbell Help Center 1 11-30-2006 06:16 AM
Java VM Crash within Ice.CommunicatorI.destroy and many threads w/ Prioxies. jae Help Center 3 10-17-2006 10:09 PM
Precisely how are Ice threads implemented? ChrisC Help Center 8 12-22-2005 12:39 PM
Multiple threads smashing the stack Ric Help Center 8 06-09-2005 01:55 PM
Contexts and threads aaron Help Center 2 01-27-2004 01:59 PM


All times are GMT -4. The time now is 11:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.