RTC Forums
November 24, 2024, 02:30:21 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Multithreaded=true  (Read 4508 times)
DPerkins
RTC License
***
Posts: 37


« on: November 07, 2013, 06:03:50 PM »

Hello

I'm just experimenting with RTC at the moment and wanted more information about the MultiThreaded property.  So far in my testing I have MultiThreaded = true (blocking=false) and I have 1 client that fires 20 requests at the server.  It seems that the server handles these 20 requests using one thread, one after the other.  Does RTC only use different threads for different clients?  If so, is it possible to use different threads at the request level?

Thanks
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: November 07, 2013, 06:27:39 PM »

RTC will use as many threads as necessary to process all pending requests as fast as possible, while at the same time obeying max thread count limits. The number of threads used will depend on the number of open physical connections, the activity received from each connection and the maximum thread count limit (default=64). Since one physical connection can only send one reuqest at a time (then wait for a response before the next request can be sent), you will never encounter a situation where one Client using a single RtcHttpClient component will use more than one thread on the Server. No matter how many requests you put into the request queue on the Client, if you are only using one RtcHttpClient component, only one request will be sent to the Server at a time. And that is what you see in your test. If you want to send multiple requests from a single Client at the same time, use multiple RtcHttpClient components in your Client.

Best Regards,
Danijel Tkalcec
Logged
DPerkins
RTC License
***
Posts: 37


« Reply #2 on: November 07, 2013, 11:48:20 PM »

Thanks for the reply - that clarifies a lot.  Any tips for creating multiple rtchttpclient components and managing them in order to have the ability to execute multiple requests in parallel?  e.g Is there a way to interrogate an rtchttpclient to see if there are pending requests?

EDIT: I suppose that having multiple rtchttpclient components will also impact session management etc
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: November 08, 2013, 10:02:15 AM »

RequestCount function on the TRtcHttpClient component returns the number of currently pending request in the request queue of that specific TRtcHttpClient component.

RTC SDK doesn't have a built-in mechanism for automatically handling multiple RtcHttpClient components. That is something you will have to handle yourself, based on the tasks you want to handle.

On the Client-side, RTC Sessions are directly linked to TRtcHttpClient components. If you use more than one TRtcHttpClient component, you will get a separate Session instance with each TRtcHttpClient component.

Best Regards,
Danijel Tkalcec
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.024 seconds with 17 queries.