Forum C# Code running for too long in dev server

Code running for too long in dev server

Postby azuanagames » September 11th, 2010, 2:19 am

I keep getting the following:

>Warning: Some code has been running for longer than will be allowed in the live enviroment. The code won't be aborted since the debugger is attached, and you might be inspecting game state.

I realize I must be doing something outragous, but, I don't think that I am...

Is there a way to tell us WHERE that code may be? A hint maybe?

At least do you know of a way for me to figure out what code causes that error? If I can set a breakpoint on your "too long" detector maybe?

Azuana Games
azuanagames
 
Posts: 157
Joined: April 29th, 2010, 10:59 pm

Re: Code running for too long in dev server

Postby Oliver » September 13th, 2010, 10:16 am

Uhm... yea, that message is not the best and could be better...

Hmm... I'm not sure but i think if you run the server in non-debug mode (Ctrl-F5), you might actually get a better message either in the developmetn server or in the error log in the admin panel.

I'll add a todo item to make it better.

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Code running for too long in dev server

Postby azuanagames » September 13th, 2010, 1:29 pm

I only get the message once in a blue moon. I'm actually running in release mode. Maybe I should actually run in debug mode? If code runs for too long in production, does that go into the error log?
azuanagames
 
Posts: 157
Joined: April 29th, 2010, 10:59 pm

Re: Code running for too long in dev server

Postby Oliver » September 13th, 2010, 3:20 pm

If code runs for too long in production, does that go into the error log?


It should... The problem is that another thread has to catch the first thread (the one taking too long) and figure out where it currently is, and that doesn't always work. So, sometimes :-)

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Code running for too long in dev server

Postby azuanagames » September 13th, 2010, 5:34 pm

Speaking of threads...

I don't handle synchronization at all. I assumed this was ok... Are there any gotchas I need to be aware of?

I'm assuming that only 1 thread is allowed access to an instance of my game at a time?

Is there ever a case where more than 1 thread can access the game class?
azuanagames
 
Posts: 157
Joined: April 29th, 2010, 10:59 pm

Re: Code running for too long in dev server

Postby Oliver » September 14th, 2010, 10:32 am

I don't handle synchronization at all. I assumed this was ok... Are there any gotchas I need to be aware of?


That is usually totally okay. Multiple threads will call into your game, but only *if* there is a ton of congestion, and we're considering making games totally single-threaded.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am


Return to C#