sriram
asked on
How to detect Unix server congestion in C++ program
Hello,
I am writing a C++ program on Solaris platform. The program continuously spawns worker threads for handling requests. Somehow the program has to detect OS congestion (high CPU, reached max usage limit or something like that) so that it could slow down handling requests and stop spawning new threads until congestion has gone. Please let me know whether it is possible.
I appreciate your help.
Thanks
I am writing a C++ program on Solaris platform. The program continuously spawns worker threads for handling requests. Somehow the program has to detect OS congestion (high CPU, reached max usage limit or something like that) so that it could slow down handling requests and stop spawning new threads until congestion has gone. Please let me know whether it is possible.
I appreciate your help.
Thanks
You should limit how many it can spawn/thread or make this a configuration option This is presumably before your application reaches a point that it gets/traps an error when malloc, or fork can not spawn, or a thread options have been exceeded.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. Sorry for the late response.