Is there a separate list for Termite questions, or is this the right place? Neil
Afficher les réponses par date
OK, looking back in history a bit, I see this is the right place, so here goes:
I'm just getting started with a distributed project, and don't want to learn Erlang at the moment. Termite seemed the logical choice, since I have some familiarity with Gambit.
So, I have a couple of computers running Gambit 4.3 with Termite installed in their lib directories. I installed the tsi script, and it starts up correctly. When I run the examples in termite.pdf, they seem to do the right thing.
However, I don't understand how to get communication between two computers working. Can someone point me to a simple example that shows how to start up Termite on two computers and get them to talk to each other?
When I tried the remote-spawn example below, I thought it was working. But I killed the Termite on the remote machine, and the example code still did exactly the same thing. It seemed the process got spawned on the local computer, even though I specified the IP address of the remote one.
(define node (make-node "192.168.1.71" 3000))
(node-init node)
(let ((me (self)))
(remote-spawn node
(lambda ()
(! me ’boo))))
#<thread #2>
(?)
boo
Thanks,
Neil Baylis
1. If you compile termite.scm, check the declarations at the beginning of the file. I use this: (declare (standard-bindings) (extended-bindings) (block) (not safe)) Note that "(block)" declaration is critical to running compiled termite code. Without it it cannot share code across nodes.
2. After compiling termite with right declarations try next example: Run two consoles and tsi on them, then do this:
tsi_1: (define n1 (make-node "127.0.0.1" 3000)) (define n2 (make-node "127.0.0.1" 3001)) (node-init n1)
tsi_2: (define n1 (make-node "127.0.0.1" 3000)) (define n2 (make-node "127.0.0.1" 3001)) (node-init n2) (on n1 (lambda () (pp "test" (##repl-output-port) "test done"))
3. If everything is ok, than you can run code across different machines without any troubles.
Vasil.
OK, looking back in history a bit, I see this is the right place, so here goes:
I'm just getting started with a distributed project, and don't want to learn Erlang at the moment. Termite seemed the logical choice, since I have some familiarity with Gambit.
So, I have a couple of computers running Gambit 4.3 with Termite installed in their lib directories. I installed the tsi script, and it starts up correctly. When I run the examples in termite.pdf, they seem to do the right thing.
However, I don't understand how to get communication between two computers working. Can someone point me to a simple example that shows how to start up Termite on two computers and get them to talk to each other?
When I tried the remote-spawn example below, I thought it was working. But I killed the Termite on the remote machine, and the example code still did exactly the same thing. It seemed the process got spawned on the local computer, even though I specified the IP address of the remote one.
(define node (make-node "192.168.1.71" 3000))
(node-init node)
(let ((me (self)))
(remote-spawn node (lambda () (! me ’boo))))
#<thread #2>
(?)
boo
Thanks,
Neil Baylis
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Here's another introduction to termite, with examples, which you might find useful.
http://theschemeway.blogspot.com/2007/04/introduction-to-termite.html
Marc
On 12-Mar-09, at 2:13 AM, Neil Baylis wrote:
OK, looking back in history a bit, I see this is the right place, so here goes:
I'm just getting started with a distributed project, and don't want to learn Erlang at the moment. Termite seemed the logical choice, since I have some familiarity with Gambit.
So, I have a couple of computers running Gambit 4.3 with Termite installed in their lib directories. I installed the tsi script, and it starts up correctly. When I run the examples in termite.pdf, they seem to do the right thing.
However, I don't understand how to get communication between two computers working. Can someone point me to a simple example that shows how to start up Termite on two computers and get them to talk to each other?
When I tried the remote-spawn example below, I thought it was working. But I killed the Termite on the remote machine, and the example code still did exactly the same thing. It seemed the process got spawned on the local computer, even though I specified the IP address of the remote one.
(define node (make-node "192.168.1.71" 3000)) (node-init node)
(let ((me (self)))
(remote-spawn node (lambda () (! me ’boo))))
#<thread #2>
(?)
boo
Thanks,
Neil Baylis _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
I'm a little confused about which versions of what are recommended for Termite.
Should I use this Termite
termite080714_2216.tar.gzhttp://termite.googlecode.com/files/termite080714_2216.tar.gz
Or this one?
svn checkout *http*://termite.googlecode.com/svn/trunk/ termite-read-only
What's the best version of Gambit to use it with?
What is the correct procedure for installing?
I'm running on Leopard/Intel, and since installing Gambit 4.4.1 (using the OSX installer) I'm not getting Vasil's test above to work. When I run it now, it hangs my computer when I execute the (on n1...) expression. I have to force-quit Terminal to recover.
It seemed to work when I was using Gambit 4.3 and the 808714... Termite package.
Note: I'm not compiling anything, either Gambit or Termite.
Neil
I send you my version of termite that definitely works. And screenshot of two gambit sessions with termite. Look at attachment to this letter.
There are several issues were fixed comparing to original version, added some useful macroses and changed loading and compiling ways.
Installation is simple: just put it in [gambit installation directory]/lib/termite and then do in lib/termite: gsc termite.scm to compile termite (it speeds up termite by several times)
Then try that test of two consoles with tsi.
BTW: Is network configuration of your computer contains properly configured loopback interface?
Try: ping 127.0.0.1
Make sure that network is ok.
Vasil.
I'm a little confused about which versions of what are recommended for Termite.
Should I use this Termite
termite080714_2216.tar.gzhttp://termite.googlecode.com/files/termite080714_2216.tar.gz
Or this one?
svn checkout *http*://termite.googlecode.com/svn/trunk/ termite-read-only
What's the best version of Gambit to use it with?
What is the correct procedure for installing?
I'm running on Leopard/Intel, and since installing Gambit 4.4.1 (using the OSX installer) I'm not getting Vasil's test above to work. When I run it now, it hangs my computer when I execute the (on n1...) expression. I have to force-quit Terminal to recover.
It seemed to work when I was using Gambit 4.3 and the 808714... Termite package.
Note: I'm not compiling anything, either Gambit or Termite.
Neil
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list