ANN: rthread - distributed computing by remote threads

Antti Kervinen ask at cs.tut.fi
Tue Dec 12 14:45:29 CET 2006


Hello!

I just wrote rthread library that makes distributed computing look
like writing multi-threaded programs. Here is a simple example that
runs print_hello function remotely and prints the name of the
remote operating system.

***

import rthread
import time

def print_hello():
    import commands
    print "Hello from %s" % commands.getoutput("uname -o")
    return 10

r=rthread.start_remote_thread(print_hello,(),
                              remotehost="hostname.domain")

time.sleep(2)
print "Finished: %s" % (r.status==rthread.status_finished)
print "Returned: %s" % r.retval

***

The only thing required from remote hosts is ssh server and executable
rthread_server (included in the package) in PATH. (The library
executes "ssh -C -c blowfish remotehost 'rthread_server'", and uses
stdin and stdout of that process as a communication channel.) There is
no need for interface definitions, no need to open communication
ports, no need to copy remotely run function code to remote hosts.

The library is working (three examples are included in the package),
but it still lacks some features, especially related to serialisation
of objects. If you are interested, please check:

http://www.cs.tut.fi/~ask/rthread/index.html

Yours,

Antti Kervinen


More information about the Python-announce-list mailing list