WeEzL said:
Isn't the idea of a seperate thread to handle saving designed to address precisely just what you're talking about? As it stands, the server must stop and wait while the world saves to the server's hard drive. Would it not be the case that saving would now be the task of a second thread thereby freeing up the main thread to continue execution without waiting for the disk subsystem? It would be the job of the second thread to wait for the disk subsystem, correct? In which case, it wouldn't matter how slow or fast the server's hard drive is because the main thread has nothing to do with saving anymore. Or is my understanding of the purpose of the second thread somewhat flawed?
"It depends". Suppose the serialization protocol were very cheap. The main thread could quickly being serializing out the server to a separate region of memory (not disk). Once done, it would go back to the main, and the second thread would take over flushing the buffers. One problem, of course, is that one has to presume enough memory available to do this (which is actually doubtful on virtually every running RunUO server in existence, IMO).
Note that simply telling thread two to persist the world objects in the main thread could run into severe transactional integrity problems. One cannot persist the entire world at once, so objects that depend on the state of other objects could suddenly be out of sync with eachother. In the worst case.
There are probably a number of interesting hacks that could be made given the ability to find clever ways to ditch the shared state problem...
Which is to say, we can't rule anything out, but it's simply not as easy as you might think.
C//