Forum C# Schedueling callbacks

Schedueling callbacks

Postby azuanagames » July 25th, 2011, 11:07 pm

As I'm working on my next game I am trying to be very conscious of the time limit. The question I have is, when I use:

Code: Select all
ScheduleCallback(delegate() {
}, 50);


Does that affect the current method call? I'm imagining the callbacks get queued, but what kind of guarantees does that give me? I just want to make sure I don't use too much CPU either.
azuanagames
 
Posts: 157
Joined: April 29th, 2010, 10:59 pm

Re: Schedueling callbacks

Postby Henrik » July 26th, 2011, 12:24 am

Each call to the callback gives you a new 100ms cputimer, so it doesn't add up or anything.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Schedueling callbacks

Postby azuanagames » July 26th, 2011, 3:27 am

How do you limit my process? Do I just get a limited number of threads that handle those callbacks?

Thanks :)
azuanagames
 
Posts: 157
Joined: April 29th, 2010, 10:59 pm

Re: Schedueling callbacks

Postby azuanagames » July 29th, 2011, 5:40 am

The reason I was asking about the limit was because it seems like it can easily get out of hand if I'm just allowed to schedule a bunch of callbacks.

I've since changed my code a bit and am not scheduling as much as I was planning to before, so it shouldn't be an issue for me.
Last edited by azuanagames on August 6th, 2011, 5:42 am, edited 1 time in total.
azuanagames
 
Posts: 157
Joined: April 29th, 2010, 10:59 pm

Re: Schedueling callbacks

Postby Oliver » August 5th, 2011, 9:33 pm

We don´t limit your game to any number of threads -- The 100ms limit is there in order to be able for us to easier distribute load among machines and not have code going into infinite loops etc.
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Schedueling callbacks

Postby azuanagames » August 6th, 2011, 5:42 am

OK Thanks!
azuanagames
 
Posts: 157
Joined: April 29th, 2010, 10:59 pm


Return to C#