[gambit-list] termite exception propagation

Guillaume Germain guillaume.germain at gmail.com
Mon Sep 10 05:50:57 EDT 2007


On 9/9/07, James Long <longster at gmail.com> wrote:
> You're right, I forgot the init, I've only used termite for local
> nodes (and init just initializes your machine for interacting with
> remote nodes, right?).  After I called init, I do indeed get #f.  I'm
> not experienced enough with Termite to know why, sorry.  I do hope to
> use Termite for a distributed application, so if you figure it out I'd
> like to know.


Hi James,

To initialize a distributed node, you need to do something like:

(node-init (make-node "host.example.com" 4321))

Then from another node, you can spawn a new process on that node by
doing something like:

(remote-spawn (make-node "host.example.com" 4321) (lambda () ...))

I usually keep a node configuration file that is shared between hosts,
and contains something like this:

;; in node-config.scm
(define node1 (make-node "foo.example.com" 4321))
(define node2 (make-node "bar.example.com" 4321))
(define node3 (make-node "bar.example.com" 4322))

To start node1, you can use the following command line (can't test the
exact syntax now, check the .sh files in the examples/ directory of
Termite):
gsi node-config.scm -e '(node-init node1)' -

So then, from node1, you can do: (remote-spawn node2 (lambda () ...))

I'm on vacation currently and away from my computer, but when I come
back next week I should be able to send you more complete examples.

Hope this helps,


Guillaume



More information about the Gambit-list mailing list