2009/1/8 Mark Volkmann <r.mark.volkm...@gmail.com>

>
> On Thu, Jan 8, 2009 at 11:05 AM, Tom Ayerst <tom.aye...@gmail.com> wrote:
> > The point, for me, is that Mark Engelberg's construct allowed the system
> to
> > work with no mutation
>
> I don't yet see how that is possible.


We agree then.


> ...
>
> Can you explain in more detail the issues you see with the current code?
>
> > Given that, and the problems with to threads accessing the Swing layer, I
> > think living in the EDT makes the most sense.  For example the
> "everything
> > in the EDT" approach takes advantage of Swing's painting features and
> deals
> > with multiple events
>

See above.

I don't remember now who suggested it, but an earlier critique of my
> code encouraged me to do as much processing as possible off the EDT.


This is one of those 'it depends' questions.  You can safely do everything
in the EDT in Swing, it will just be very sluggish (and freeze occasionally)
if you have long running actions on events.  So it is good practice to spin
off workers in separate threads for anything that will take a while.
Nothing in the snake app falls into that category.  Also; if you are spining
off additional threads they must use invokeLater to safely rejoin the EDT
for displaying updates.


> > while cleanly painting the board; the two thread
> > approach flickers terribly when the snake is short.
>
> I could be wrong, but I don't think that flicker is related to my
> choice of doing the painting off the EDT. I think it's just a matter
> of the relatively large cell size.
>

I use the same cell sizes on a derivative of Stuart's version and that does
not flicker.

Cheers

Tom

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to