Re: About MBR SAO and threads...

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Sunny (sunnyask_at_icebergwireless.com)
Date: 03/23/04


Date: Tue, 23 Mar 2004 09:09:32 -0600

Hi Elp,
as far as I know, every method call is executed in a different thread.
So if 2 threads in the client are making 2 different calls to remoted
object, you have to make your code thread safe, as there is no remoting
at all.

Sunny

In article <uFEcBeNEEHA.684@tk2msftngp13.phx.gbl>,
rockfamily@REMOVEME.hotmail.com says...
> Hi,
>
> I'd like to have some advices on threads and .NET Remoting in order to do a
> reliable implementations of my remote objects.
>
> Here is the plot: i'm exposing a MBR object (let's call it ManagerObject) as
> a singleton. This object contains several methods, one of them returning an
> instance of a second MBR object (ClientObject, singleton as well). Imagine
> that every method of those 2 objects take several seconds to execute.
>
> What i'd like to know is: is each call to a method of either one of those
> objects executed in a single thread or does .NET Remoting uses a new thread
> for each call?
>
> In real life, here is my question:
> - if 2 clients (or 2 threads of the same client; that's the same situation)
> call 2 different methods of my ManagerObject at almost the same time, will
> those 2 methods be executed simultaneously or one after the other?
> - same question if those 2 clients call the *same* method of my
> ManagerObject at the same time.
> - what if one client calls a method of my ManagerObject and the other a
> method of my ClientObject?
>
> The problem here is quite obvious: do i need to take care of synchronisation
> problems in my implementation or can i safely assume that my object are
> going to be used in a single-threaded environment?
>
> Thanks a lot.
>
>
>



Relevant Pages

  • Re: About MBR SAO and threads...
    ... thread safe in the mbr. ... i'm exposing a MBR object (let's call it ManagerObject) as ... >instance of a second MBR object (ClientObject, singleton as well). ... >that every method of those 2 objects take several seconds to execute. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: About MBR SAO and threads...
    ... When you use a singleton SAO, the server will guarantee that only one ... > I'd like to have some advices on threads and .NET Remoting in order to do ... i'm exposing a MBR object (let's call it ManagerObject) ... > that every method of those 2 objects take several seconds to execute. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Singletons
    ... Such attributes are usually initialized by the constructor or a factory object when the object in hand is created. ... There are actually two objects involved in Singleton. ... To access that method there must already be a relationship that can be navigated by the client to get to the Singleton object to invoke GetInstance. ... When Singleton passes back the reference to Client it is temporarily instantiating the R3 relationship between Client and the Collaborator that Client navigates when it talks to Collaborator. ...
    (comp.object)
  • Re: Singletons
    ... By modifying the context I meant that one defines the solution flow of control differently so that the instantiation can be done in one place rather than in several. ... Singleton is really just a specialized factory object. ... There is no way for the client to know whether the instance returned is one of one or one of many. ... Because many network protocols limit the size of the message so it has to be split up into separate packets. ...
    (comp.object)
  • Re: beginner Qs about COM/.NET (context = exposing a pre-existing app to scripting)
    ... You can even use a C++ singleton class. ... > objects into a script variable, and lets it sit on the shelf, my server ... it is the client that determines when to call Releaseon your object. ... > I think I have to use MTA; while program A is using the serial port, ...
    (microsoft.public.vc.atl)