HighTechTalks DotNet Forums  

Remoting Singleton v.s. SingleCall

Dotnet General Discussions microsoft.public.dotnet.general


Discuss Remoting Singleton v.s. SingleCall in the Dotnet General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
JSheble
 
Posts: n/a

Default Remoting Singleton v.s. SingleCall - 08-03-2005 , 03:55 PM






I understand the difference between the two types (Singleton & SingleCall)
but what affect does this have if the Remoting Server accepts multiple
connections from multiple clients, and they're all sending messages or using
methods? Does it (server) manage this automatically?




Reply With Quote
  #2  
Old   
Mehdi
 
Posts: n/a

Default Re: Remoting Singleton v.s. SingleCall - 08-03-2005 , 05:08 PM






On Wed, 3 Aug 2005 13:55:00 -0700, JSheble wrote:

Quote:
I understand the difference between the two types (Singleton & SingleCall)
but what affect does this have if the Remoting Server accepts multiple
connections from multiple clients, and they're all sending messages or using
methods? Does it (server) manage this automatically?
Yes. If you published your object as a Singleton (or used Remoting.Marshall
to publish your object), the server will make sure that there is always at
most one instance of your object created and all your clients will always
access the same object.

If you publish your object as Single Call, then the server will alwasy
create a new instance of the object whenever a client calls one of its
method and will destroy the object afterwards, which ensures you that
you'll never have 2 clients or the same client accessing the same instance
twice.


Reply With Quote
  #3  
Old   
JSheble
 
Posts: n/a

Default Re: Remoting Singleton v.s. SingleCall - 08-03-2005 , 06:15 PM



Ok, but I'm still a bit confused about multiple clients connecting to a
Singleton object... what if multiple clients all call the same method
simultaneously? Say 3 clients all call the same method, does the 2nd and
3rd call wait until the first finishes? Meaning does it queue the calls?


"Mehdi" <vioccc (AT) REMOVEME (DOT) gmail.com> wrote

Quote:
On Wed, 3 Aug 2005 13:55:00 -0700, JSheble wrote:

I understand the difference between the two types (Singleton &
SingleCall)
but what affect does this have if the Remoting Server accepts multiple
connections from multiple clients, and they're all sending messages or
using
methods? Does it (server) manage this automatically?

Yes. If you published your object as a Singleton (or used
Remoting.Marshall
to publish your object), the server will make sure that there is always at
most one instance of your object created and all your clients will always
access the same object.

If you publish your object as Single Call, then the server will alwasy
create a new instance of the object whenever a client calls one of its
method and will destroy the object afterwards, which ensures you that
you'll never have 2 clients or the same client accessing the same instance
twice.



Reply With Quote
  #4  
Old   
Oliver Sturm
 
Posts: n/a

Default Re: Remoting Singleton v.s. SingleCall - 08-04-2005 , 03:45 AM



JSheble wrote:

Quote:
Ok, but I'm still a bit confused about multiple clients connecting to a
Singleton object... what if multiple clients all call the same method
simultaneously? Say 3 clients all call the same method, does the 2nd and
3rd call wait until the first finishes? Meaning does it queue the calls?
If I'm not completely mistaken, it runs multiple threads, one for each
incoming request. That's why it's important to code Singleton objects
thread-safe for use in Remoting.



Oliver Sturm
--
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619 http://www.sturmnet.org/blog


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.