Author: zturner0826zturner0826
Date: Jul 16, 2008 11:11
This is a bit of a strange question, and I'm actually having a bit of
trouble even phrasing it correctly.
I have a poorly designed server application that creates a separate
thread for every client request and processes a task in that thread.
Each thread has its own socket that it can communicate with its
corresponding client. Because of this, all socket I/O on an
individual socket is synchronous, and the ability to communicate with
multiple clients at the same time is handled by the thread scheduler.
Obviousy this is not terribly scaleable, as if I have say, 100 clients
then I have 100 threads. This results in a massive amount of context
switches, slowing down the performance of my application.
My goal is to find out -how much- it slows down the application. So
in this sense I want to know how much time the OS spends switching out
of or into one of the threads in my process. Even the ability to
find out how many context switches occured either to or from threads
in my process would be a good start, although I would also like to be
able to pin down how much time is associated with each actual context
switch.
|