Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

CPU usage goes to 100%  RSS feed

 
Karup Mew
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

when I try to regeistering the clients through register method of SocketChannel class sometimes its occupy the cpu memory full suddenly sytem hangs. I dont why its happened Kindly sove this problem if anybody knows the solution.
[ December 08, 2008: Message edited by: Karup Mew ]
 
Rusty Shackleford
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does this run in a loop?

With nothing to block, of course it is going to take all your CPU time since it never rests.
 
Karup Mew
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rusty Shackleford:
Does this run in a loop?

With nothing to block, of course it is going to take all your CPU time since it never rests.


Yes this is running in a loop
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just add a few microseconds sleep to the thread which is in while loop. You will see the difference.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!