Re: Multi-threaded Worker Objects
- From: mtv <mtv@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 29 Jan 2007 07:49:00 -0800
Robson,
Your design is exactly what I was asking about. What you've said is very
helpful. If you can elaborate how your remote object return values to
corresponding clients, I would appreciate it.
Recap: Multiple clients can call your remoted Worker singleton object, which
in turns spawn worker threads (say, 1 new thread per new client). Once the
thread(s) is complete and say, need to return some client-specific values,
how can you determine the right client to return values?
Thanks.
--
Your 2 cents are worth $milion$. Thanks.
"Robson Siqueira" wrote:
mtv..
It will depend on your design. With the details you gave, I don't think I
can be of much help.
I can explain, for instance, an application I have here and maybe you will
identify with yours. My application is basically a windows service, remoting
a singleton object. This application can receive simultaneous calls by
different clients. Within the work class I spawn all my work on different
threads. Therefore, I wait all them to finish. This means that the call from
a client perspective is synchronous but the work done within that call is
spawned in different threads for maximum performance.
Due to the way I coded the work class - and furthermore the object class
which is remoted - I can have different clients calling the same server
activated object (my singleton object). Everything I need is passed thru
parameters.
In my specific case, threading really helped. My windows service deals with
huge amount of processing. In this case, this is a distributed application
(I have more servers running the same windows service and a "master" windows
service distributing the load).
If you can provide more details, maybe I can be of help.
--
Regards,
Robson Siqueira
Enterprise Architect
"mtv" <mtv@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:15E57357-AFE3-4003-96AD-06C9605E9727@xxxxxxxxxxxxxxxx
With the multi-threading design, how does the remote object know which
client
to return the value to (for synch or asynch calls)?
And for synch calls, does threading really help? I did this test and found
threading did not help. I think it's b/c Synch call is the blocking mode;
therefore, one call, at a time, is served. Perhaps you have different way
to
make it work.
Thanks.
--
Your 2 cents are worth $milion$. Thanks.
"Robson Siqueira" wrote:
I think that a ThreadPool is your friend :)
Take a look on this framework, which extends the features of the native
.net
ThreadPool class. I use this for quite some time.
http://www.codeproject.com/cs/threads/smartthreadpool.asp
--
Regards,
Robson Siqueira
Enterprise Architect
"maheshgv" <maheshgv@xxxxxxxxx> wrote in message
news:1169594351.037963.38910@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a class exposed as a singleton using remoting. Mutliple
instances of the client application will connect to this singleton
object. After successfull authentication, I create different
workerprocess objects (tied using a unique SessionID) which actually
does the work. I want these instances to be running in different
threads so as to increase the performance. Also, all the subsequent
calls from the client will be forwarded to the associated worker
process object. Is there any way these new instances be spawned on
different threads?
- Follow-Ups:
- Re: Multi-threaded Worker Objects
- From: Robson Siqueira
- Re: Multi-threaded Worker Objects
- References:
- Multi-threaded Worker Objects
- From: maheshgv
- Re: Multi-threaded Worker Objects
- From: Robson Siqueira
- Re: Multi-threaded Worker Objects
- From: Robson Siqueira
- Multi-threaded Worker Objects
- Prev by Date: Re: Replicating text files (or serialized ones) with .net
- Next by Date: Re: Remoting SAO help
- Previous by thread: Re: Multi-threaded Worker Objects
- Next by thread: Re: Multi-threaded Worker Objects
- Index(es):
Relevant Pages
|