[racket] plot-frame does not wait at end of process

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Mar 11 16:42:13 EDT 2013

Michael Wilber kindly sent me the link:


and I think that this is not really a good argument for changing the
default behavior. A keyword argument that says "create a new eventspace"
seems okay, but the docs should explain that this is multi-threading, and
if you were to invoke methods of the plot frame without first going to the
new eventspace (via queue-callback or something like that), then you'll
probably get bad behavior.


On Mon, Mar 11, 2013 at 1:55 PM, Eli Barzilay <eli at barzilay.org> wrote:
> A few minutes ago, Robby Findler wrote:
> > There is a tension here, but I actually think Racket's default
> > strategy is the best one (Matthew and I have discussed this a fair
> > amount way back when we were first getting GUI stuff going in
> > Racket; Java's strategy is different and leads to race-conditions
> > easily, for example.).
> In this case, things are kind of obvious if you know about eventspaces
> and about the per-plot eventspace feature -- but since this is a quirk
> that only plot is doing, most people don't expect it and get
> surprised.
> > So if plot's function were just something like:
> >
> >   (define (plot-frmae the-args)
> >     (define f (new frame% ...))
> >     ..put stuff in frame..
> >     (send f show #t))
> >
> > Then just hitting run in DrRacket would show you the multiple plots in
> > separate frames fine. At the command-line if you script was
> >
> > #lang racket
> > (require plot)
> > (plot-frame ...)
> > (plot-frame ...)
> > (plot-frame ...)
> >
> > then that would also work fine (not exiting until you closed all the
> > windows).
> +17 if it can work like this.  Otherwise, if there's a reason it
> can't, then I think that the new-namespace could be available as a
> keyword or parameter thing.  But the default should be the
> no-surprises version.
> > I can't recall anymore the use-case that let Neil to what he's done
> > here, so we probably should revisit that.
> --
>           ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                     http://barzilay.org/                   Maze is Life!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130311/1b1a867c/attachment.html>

Posted on the users mailing list.