PEP8 fixes and removing of global variable

First, the code is not well formated, but it's not that bad: some comments, lines are not too long, and at least you keep it pretty consistent.

Second, there was an issue with the global "alloc". It's bad. It's very bad. At so many level it's hard to explain. I replaced this by using an attribute on the server class. As its instance is available to each RequestHandler through its attribute "server", it's easy to replace a global "alloc" to "self.server.alloc".

And last but not least, there is a big issue with the multi-threading handling: the alloc dict is not thread safe, and your code clearly ask for thread-safety, as you heavily rely on threading mecanisms.
To fix this one, we need a long conversation about what you really try to do, what you want to learn, and what you want to achieve at the end of your journey with such project.

Nevertheless, it'll be fun. :)