D.Tkalcec (RTC)
|
|
« Reply #4 on: October 25, 2015, 11:17:49 AM » |
|
If the lockup you are experiencing is not a result of wrong critical section use (see my initial reply), the only other thing that comes to mind which could result in a situation resembling a "lockup" are requests or remote functions processed by the Server which take a very long time to execute or never complete.
Every request and remote function occupies one thread from the RTC thread pool while being executed. If the Thread Pool is not allowed to grow and all the threads from the pool are in use, the Server will stop accepting new connections and processing requests from other connected Clients until at least one thread becomes available again.
All RTC Thread Pool parameters are defined in the "rtcThrPool.pas" unit. The most important parameter there is "RTC_THREAD_POOL_MAX", which is set to 256 by default. That should be more than enough for a very busy Server, handling thousands of Client connections. You can modify that value in your Project before starting the Server Listener to see if it has any effect on your problem. Reducing the maximum thread pool size should lock the Server up sooner, while increasing the value would make the Server last longer. When changing RTC Thread Pool parameters, please keep in mind that Windows has a limit of about 1020 threads, which are shared by all the running processes, so you shouldn't go too high with this number, or you will end up with other kinds of problems.
RTC also comes with simple thread-safe logging functions, available in the "rtcLog.pas" unit (see "Log" and "XLog" procedures there), which you could use to log function entry and exit points if you need to find out which one of your functions take too long to execute or never completes, probably causing this "lockup" issue.
If nothing helps and you need my assistance, then I will need a lot more details about the way you are using the component, or ... an example Project using only the RTC SDK and standard Delphi components which can be used to reproduce the problem, so I can debug it on my machine.
Best Regards, Danijel Tkalcec
|