[Opensim-dev] things I learned today about Timers

Sean Dague sean at dague.net
Wed Apr 16 11:08:30 UTC 2008


They aren't thread safe:

http://msdn2.microsoft.com/en-us/library/system.timers.timer.aspx

Previously in the Sim Stats collection we were Enabling, Disabling the
timer as a mutex, which is very very wrong based on what I've now read
in the Mono source code (check out the Timer.cs Enabled = true property
some time.  It does *a lot*).

I modified Sim Stats to just use a lock instead.  I believe this is at
least part of the solution to the invoke_void crash (too early to call
it fixed).  I also think this is related to my 100% CPU issue (though
still too early to say there).  Regardless, the old approach was
proovably incorrect, and the new one is the way things should be done.

    -Sean

-- 
__________________________________________________________________

Sean Dague                                       Mid-Hudson Valley
sean at dague dot net                            Linux Users Group
http://dague.net                                 http://mhvlug.org

There is no silver bullet.  Plus, werewolves make better neighbors
than zombies, and they tend to keep the vampire population down.
__________________________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20080416/035819c7/attachment-0001.pgp>


More information about the Opensim-dev mailing list