[Opensim-dev] Proposal: Slowly making less of the Scene.Update() loop synchronous
Melanie
melanie at t-data.com
Fri Sep 10 00:33:52 UTC 2010
You need to carefully evaluate the issues this causes, specifically
the issue of something being started multiple times in parallel
because it's so slow.
Update()
{
DoOneSlowThing();
DoASlowSynchrnousThing();
}
converted to
Update())
{
Util.FireAndForget(DoOneSlowThing, null);
DoASlowSynchrnousThing();
}
may cause DoOneSlowThing to be run multiple times, concurrently. For
most Update() parts, that is ano-no.
Melanie
Justin Clark-Casey wrote:
> Whilst bug hunting today, I had reason to dive into the Scene.Update() loop. This is called many times per second and
> is in charge of updating the entire scene (moving avatars in response to client input, sending queued object updates to
> the client stack, etc.). The time taken by this loop increases as the number objects and avatars in the scene increase.
>
> There's quite a lot of code hanging off this loop that looks like it could be carried out asynchronously instead. This
> particularly applies to some of the stuff being invoked via EventManager rather than called directly.
>
> If the amount of synchronous code here could be reduced then this could improve scene performance and reduce instances
> where delays in the called code temporarily freeze the update loop. These problems can be very hard to track down.
>
> Unless there are any countervailing technical arguments, I'd like to start slowly looking at this over the long term.
> This might go so far as making some loop-triggered EventManager events asynchronous rather than synchronous. I know
> there is a fair amount of code that does depend on synchronous execution so any changes will be done slowly and carefully.
>
> Regards,
>
More information about the Opensim-dev
mailing list