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%?
100% CPU Usage...
Moderator: Board moderators
-
- New poster
- Posts: 8
- Joined: Thu Jul 13, 2006 8:36 am
- Location: Indonesia
- Contact:
-
- Guru
- Posts: 584
- Joined: Thu Jun 19, 2003 3:48 am
- Location: Sanok, Poland
- Contact:
-
- New poster
- Posts: 8
- Joined: Thu Jul 13, 2006 8:36 am
- Location: Indonesia
- Contact:
-
- Guru
- Posts: 584
- Joined: Thu Jun 19, 2003 3:48 am
- Location: Sanok, Poland
- Contact:
Select would be useless if it couldn't handle it, would it? You can use exception sets, you can set a timeout. Read the manual or look for examples, there are plenty of them on the web.
For millions of years, mankind lived just like the animals. Then something happened which unleashed the power of our imagination. We learned to talk and we learned to listen...