Imagine Nation Forums
Asynchronous Worldsaves - Printable Version

+- Imagine Nation Forums (https://in-uo.net/forums)
+-- Forum: Imagine Nation archive (https://in-uo.net/forums/forumdisplay.php?fid=6)
+--- Forum: Suggestions (https://in-uo.net/forums/forumdisplay.php?fid=28)
+--- Thread: Asynchronous Worldsaves (/showthread.php?tid=4796)



Asynchronous Worldsaves - Nasir - 02-16-2012

Hey duds,

While trying to figure out a way to iterate over the massive amount of Items and Mobiles in memory without locking, I remembered the new ConcurrentDictionary<TKey, TValue> class in .NET 4.0. Vorspire had the idea to apply that to worldsaves Smile. I've already used ConcurrentDictionary for something similar at work, so I already know it will work for worldsaves. I just don't remember enough about RunUO to confidently implement it.

Vorspire does, though, and it looks like he's going to give it a go! Here's a thread worth subscribing to, as it might prove to be somewhat awesome in the not-so-distant-future.

http://www.runuo.com/community/threads/world-items-mobiles-concurrentdictionary-tkey-tvalue.505273/#post-3838554


Asynchronous Worldsaves - Eru - 02-16-2012

I think we have saving without freezing now unless you use the .save command. I think it was included in one of the SVN updates.


Asynchronous Worldsaves - Taran - 02-16-2012

Yeah the RunUO dev team changed something with saves a while back which makes it save in the background or something. Takes about half a second to save 13k mobiles and 224k items


Asynchronous Worldsaves - Nasir - 02-16-2012

They introduced the dynamic save strategy which uses the Task Parallel library to iterate over the items much, much faster. However, the collections still have to be locked on to prevent changes while going through them. ConcurrentDictionary make it easy for someone to implement a completely async save strategy where saves could be done in the background without locking at all.

It's fun stuff ;p