100% CPU Usage...
Posted: Wed Jan 10, 2007 11:23 am
hi all.. i was developing a new software for my college project.. it was acting as a middletier between application and database for safety reason... the software works fine but when i look at task manager->performance, when my software ran, cpu time will rise up to 100%...
here's a little look at how my software works logically...
BEGIN LISTING
-----------------------------------------------------------------------------
// this will load up some configuration and prepare the socket
middleTier.InitMiddleTier();
while(!middleTier.isShutDown()) {
// here i will see if the socket active (is any client trying to connect)
if(middleTier.peekSocket()) {
// if the socket is active, accept the connection, then create a thread
// for handling further request from that client
middleTier.addClient();
}
}
// the middleTier has been closed/died, cleanup
middleTier.cleanUp();
-------------------------------------------------------------------------------
END LISTING
can you spot the problem why my software would eat up cpu time to 100%?
here's a little look at how my software works logically...
BEGIN LISTING
-----------------------------------------------------------------------------
// this will load up some configuration and prepare the socket
middleTier.InitMiddleTier();
while(!middleTier.isShutDown()) {
// here i will see if the socket active (is any client trying to connect)
if(middleTier.peekSocket()) {
// if the socket is active, accept the connection, then create a thread
// for handling further request from that client
middleTier.addClient();
}
}
// the middleTier has been closed/died, cleanup
middleTier.cleanUp();
-------------------------------------------------------------------------------
END LISTING
can you spot the problem why my software would eat up cpu time to 100%?