Odon Wrote:Ok some awfull patch, in XBApplicationEx.cpp, search for "while" and add a sleep(1) just after.
edit: have another issue, database is not responding through web server :/Code:
// Run xbmc
i've just rebased this onto the current master branch of xbmc, and i'm recompiling as we speak to see whether it makes any difference.
edit: no, it doesn't make any difference. still getting 100% of a single cpu in use.
i'm not sure if XBApplicationEx.cpp is going to be called as i think the changes i made prevent the application from calling that, but i could be wrong. if it is called, then checking the server mode flag and preventing that loop from executing at all would do the same job without the need to make it sleep, which would only prevent it from spiking, and would also prevent it from working properly when not in server mode. good spot, though, and i reckon i can put the serverMode flag check in there instead and skip over that entire section of code.
edit: silly me - yes, it's called, and it's obviously calling the methods in the Application.cpp class. so instead of changing that class, i've put the server mode check into the methods that it's calling in Application.cpp instead like i've done elsewhere. i've also added the sleep(1) into the code as suggested to see if that helps. i think the issue is that the code is designed to be active rather than passive, so it responds as quickly as it possibly can to an event. as such, it's pretty much always going to be taking up 100% as it's going to run as fast as it can to listen to everything it's been told to listen to. it's not acting as a passive event listener, if that makes any sense - it's actively checking instead. a sleep command will let it stop working briefly, but i suspect that it's always going to take up an entire cpu unless someone can find another mechanism to slow it up a little. as it stands, though, this little hack appears to have massively dropped the cpu usage (currently sitting at 1.8% atm). seems to be working as it did before for me, so good call for this little hack
as to database, i've no idea - what are you using the query the database?