Fixed cpu hog issue

Stay up to date with shard happenings
Locked
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Fixed cpu hog issue

Post by Red Squirrel »

I just restarted the server to do a core edit to runuo. The cpu hog issue is now gone. There should no longer be lag spikes when lot of activity is going on.

This is bad:

Code: Select all

while(1) 
{
//do stuff here
}
And that this is good:

Code: Select all

while(1) 
{
Thread.Sleep(1);
//do stuff here
}
There was actually a check against single or duel cpu, if it was duel then it did not have sleep, causing runuo to basically choke itself in a cpu hogging loop.

Archived topic from AOV, old topic ID:1435, old post ID:8985
Honk if you love Jesus, text if you want to meet Him!
Locked