A Question about Async Dispatching

RCF support and general discussion.
Post Reply
zhanghuan929
Posts: 1
Joined: Thu Jun 12, 2014 12:48 am

A Question about Async Dispatching

Post by zhanghuan929 »

In my design, my client uses sync two way and the server uses a thread pool and async dispatching technology(put the session to a queue) and the worker thread will fetch the queue and do the real long time job.
If there are thousands of clients that call the server. I know the listening thread pool will async dispatching the request to the queue, and waiting for the worker threads to execute the request.
But my question is that
1 are these dispatched connections still cost resouces except the memory cost in the request queue.(i'm confused when using async dispatching, what happened to the socket? does it need to maintain a heart beat to the client socket?)
2 if my client uses async two way, is there a benefit.

Thanks

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: A Question about Async Dispatching

Post by jarl »

(1) On the server side, async dispatching just means you are using threads of your own to process requests, rather than relying on RcfServer threads. There's no extra resource cost, and no change to the socket. However you'll need to be careful that your request queue doesn't grow in an unbounded way.

(2) Async calls on the client side are useful if you want to avoid a thread blocking on a remote call. Async calls are a bit more complex to code though, than sync calls. Whether you are using async or sync calls, the network traffic is exactly the same.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

Post Reply