Re: [racket-users] Ensuring that channels are GC'd when the child thread terminates

2019-10-02 Thread David Storrs
Ok, thanks. On Wed, Oct 2, 2019, 4:16 PM Matthew Flatt wrote: > At Wed, 2 Oct 2019 11:06:14 -0400, David Storrs wrote: > > On Wed, Oct 2, 2019 at 8:42 AM Matthew Flatt wrote: > > > It depends on `process-file`. If `process-file` retains `msg` until it > > > is otherwise done, then yes. But if

Re: [racket-users] Ensuring that channels are GC'd when the child thread terminates

2019-10-02 Thread Matthew Flatt
At Wed, 2 Oct 2019 11:06:14 -0400, David Storrs wrote: > On Wed, Oct 2, 2019 at 8:42 AM Matthew Flatt wrote: > > It depends on `process-file`. If `process-file` retains `msg` until it > > is otherwise done, then yes. But if `process-file` ignores the argument > > for `msg` or only uses it for the

Re: [racket-users] Ensuring that channels are GC'd when the child thread terminates

2019-10-02 Thread David Storrs
On Wed, Oct 2, 2019 at 8:42 AM Matthew Flatt wrote: > > At Tue, 1 Oct 2019 23:52:05 -0400, David Storrs wrote: > > ; main dispatcher loop in the server. Receives messages, dispatches > > to child thread for processing > > > 2) This WOULD work: > > (let loop () > > (define msg

Re: [racket-users] Ensuring that channels are GC'd when the child thread terminates

2019-10-02 Thread Matthew Flatt
At Tue, 1 Oct 2019 23:52:05 -0400, David Storrs wrote: > ; main dispatcher loop in the server. Receives messages, dispatches > to child thread for processing > (struct file-info (hash) #:transparent) > (define channels (make-weak-hash)) > (let loop () > (define msg (get-next-message)) ;

[racket-users] Ensuring that channels are GC'd when the child thread terminates

2019-10-01 Thread David Storrs
I have a server with a main dispatcher loop that receives messages and farms them out to processing threads. I'd like to have able to have later messages inform the behavior of earlier message processing -- an example would be "message 1: here is a file to download" followed by "stop downloading