[gambit-list] Threading and TCP-SERVICE-REGISTER! (or, how to
Christian Jaeger
chrjae at gmail.com
Wed Nov 18 19:40:31 EST 2009
> .. It still doesn't seem to work. ..
> .. (thread-thread-group (current-thread)))
Well, I'm not sure which thread(s) you want to see; what I was
implicitely suggesting is create a *new* group and then give that to
|tcp-service-register!|. See the following; although it doesn't make
any difference, you only don't need to filter out other threads
anymore; I do see threads created by the tcp service when connections
are coming in; but there does not seem to be any tcp service "master
thread"; dunno why, maybe the implementation works without using a
thread. If your problem is that you don't see any master thread, then
why would you want it? I'd expect it never exits (except when running
tcp-service-unregister!), so why would you want to join it?
> (tcp-service-register! 10000 (lambda args (pp args)(thread-sleep!
10)) (thread-thread-group (current-thread)))
> (vector->list (thread-group->thread-vector (thread-thread-group
(current-thread))))
(#<thread #1 primordial>)
$ telnet localhost 10000
> ()
(vector->list (thread-group->thread-vector (thread-thread-group
(current-thread))))
(#<thread #1 primordial> #<thread #3 #<input-output-port #4 (tcp-client)>>)
and with the new group:
> (define g (make-thread-group "my-tgroup"))
> (vector->list (thread-group->thread-vector g))
()
> (tcp-service-register! 10000 (lambda args (pp args)(thread-sleep! 10)) g)
$ telnet localhost 10000
> ()
(vector->list (thread-group->thread-vector g))
(#<thread #5 #<input-output-port #6 (tcp-client)>>)
> Also, are you receiving duplicates of my emails? I'm getting 2
> duplicates for some reason each time I send one to the list,
I'm not getting duplicates from you, neither do gname nor the archive
at umontreal show any; you're probably seeing the same as I do in
gmail, your replies don't group into the same threads for some reason
(and I've checked that in-reply-to is there and correct) whereas the
outgoing mail *is* grouping into the original thread, so this looks
like a gmail web interface bug.
More information about the Gambit-list
mailing list