Persistent Distributed Objects
gandalf at shopzeus.com
Sat Oct 10 09:36:09 CEST 2009
> Sorry about being interpreted as being vague.
You wasn't vague. I'm sorry!
> `et me try to narrow it down. program a creates objects b c d which each need to use 1 disk space 2 ram 3 processor time. I would like to create a checkpoint which would save the work of the object to be later used and then delete it from memory [which I assume from reading about them implimented elsewhere is more or less how they work]. The other part would be to assign the objects via a network depending on the number of network machines. I.e. suppose b c and d see machines e f g on a network they can send those machines objects b c and d and have any work saved on the main machine or local ones. What I was wondering is how would I do that in python. The arbitrary part could be no more complicated than a program where b is calculating a list of prime numbers from x to infinity c is just a notepad program and d is a program that prints say the size of the file as youi type it and says " I like writing a poem of [bytes big] while my computer foun ou that [new prime] is the biggest on [machines #] computers. Rmi supposedly does this for the distribuited part. Object persistence does this for saving to the best of what I`ve seen nothing distributes and saved at the same time. Does that help?
The pickle module is part of the standard library and it can dump and
load objects. One thing you need to worry about is that your machines
must share the same code base. You cannot load a pickled object if its
class is not available for the interpreter. Apart from that, it is not
really problematic to send pickled objects over the network. Just choose
any protocol you want. You can try already existing networking libraries
for this. Twisted, for example. Or you can use systems that where
specifically designed for building distributed networks. Look at Pyro.
They manage things like "what computers are available" automatically.
When it comes to distributing objects, the other thing comes in mind is
security. Sending sensitive data (or even worse, sending code) over the
network is a security concern.
I hope I could help and sorry again. It's my bad english.
More information about the Python-list