Hi Gambit List,
(I'm not sure if this is the right forum to ask termite questions, apologies if not)
My understanding from the termite paper is that linked processes propagate exceptions to exception catchers/handlers, and so I was expecting the following to return #t:
(define (test-spawn-link) (with-exception-catcher (lambda (exception) #t) (lambda () (spawn-link (lambda () (raise 'dying))) (? 5) #f) ))
(init) (test-spawn-link)
However this returns #f, indicating that the handler isn't called. Moreover the value of the exception is returned by the receiver (? 5). Am I missing something or has this behaviour changed since the paper?
Also, is there anywhere else to get documentation for termite?
(tested on gambit 4b22 and 4.0.0)
Many thanks,
Phil
Afficher les réponses par date
The below code works for me (which is exactly the same as yours):
(define (test-exceptions) (with-exception-catcher (lambda (exception) #t) (lambda () (spawn-link (lambda () (raise 'dying))) (? 5) #f)))
$ gsi
(include "test-exceptions.scm") (test-exceptions)
#t
I'm on gambit 4b22 with the latest version of termite and running OS X. Although I can't directly help you, it may help to know that it should work that way.
On 9/7/07, Phil Dawes pdawes@users.sf.net wrote:
Hi Gambit List,
(I'm not sure if this is the right forum to ask termite questions, apologies if not)
My understanding from the termite paper is that linked processes propagate exceptions to exception catchers/handlers, and so I was expecting the following to return #t:
(define (test-spawn-link) (with-exception-catcher (lambda (exception) #t) (lambda () (spawn-link (lambda () (raise 'dying))) (? 5) #f) ))
(init) (test-spawn-link)
However this returns #f, indicating that the handler isn't called. Moreover the value of the exception is returned by the receiver (? 5). Am I missing something or has this behaviour changed since the paper?
Also, is there anywhere else to get documentation for termite?
(tested on gambit 4b22 and 4.0.0)
Many thanks,
Phil
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
After you've initialized termite with (init)?
Cheers,
Phil
James Long wrote:
The below code works for me (which is exactly the same as yours):
(define (test-exceptions) (with-exception-catcher (lambda (exception) #t) (lambda () (spawn-link (lambda () (raise 'dying))) (? 5) #f)))
$ gsi
(include "test-exceptions.scm") (test-exceptions)
#t
I'm on gambit 4b22 with the latest version of termite and running OS X. Although I can't directly help you, it may help to know that it should work that way.
On 9/7/07, Phil Dawes pdawes@users.sf.net wrote:
Hi Gambit List,
(I'm not sure if this is the right forum to ask termite questions, apologies if not)
My understanding from the termite paper is that linked processes propagate exceptions to exception catchers/handlers, and so I was expecting the following to return #t:
(define (test-spawn-link) (with-exception-catcher (lambda (exception) #t) (lambda () (spawn-link (lambda () (raise 'dying))) (? 5) #f) ))
(init) (test-spawn-link)
However this returns #f, indicating that the handler isn't called. Moreover the value of the exception is returned by the receiver (? 5). Am I missing something or has this behaviour changed since the paper?
Also, is there anywhere else to get documentation for termite?
(tested on gambit 4b22 and 4.0.0)
Many thanks,
Phil
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
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.
On 9/7/07, Phil Dawes pdawes@users.sf.net wrote:
After you've initialized termite with (init)?
Cheers,
Phil
James Long wrote:
The below code works for me (which is exactly the same as yours):
(define (test-exceptions) (with-exception-catcher (lambda (exception) #t) (lambda () (spawn-link (lambda () (raise 'dying))) (? 5) #f)))
$ gsi
(include "test-exceptions.scm") (test-exceptions)
#t
I'm on gambit 4b22 with the latest version of termite and running OS X. Although I can't directly help you, it may help to know that it should work that way.
On 9/7/07, Phil Dawes pdawes@users.sf.net wrote:
Hi Gambit List,
(I'm not sure if this is the right forum to ask termite questions, apologies if not)
My understanding from the termite paper is that linked processes propagate exceptions to exception catchers/handlers, and so I was expecting the following to return #t:
(define (test-spawn-link) (with-exception-catcher (lambda (exception) #t) (lambda () (spawn-link (lambda () (raise 'dying))) (? 5) #f) ))
(init) (test-spawn-link)
However this returns #f, indicating that the handler isn't called. Moreover the value of the exception is returned by the receiver (? 5). Am I missing something or has this behaviour changed since the paper?
Also, is there anywhere else to get documentation for termite?
(tested on gambit 4b22 and 4.0.0)
Many thanks,
Phil
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
On 9/9/07, James Long longster@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