Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #5169

Re: a tight game loop in Swing

From Lew <noone@lewscanon.com>
Newsgroups comp.lang.java.gui
Subject Re: a tight game loop in Swing
Date 2012-06-06 23:58 -0700
Organization albasani.net
Message-ID <jqpjeu$i1k$1@news.albasani.net> (permalink)
References <tight-game-loop-20120604142027@ram.dialup.fu-berlin.de> <nospam-E06F2C.11012604062012@news.aioe.org> <01353eab-26e6-442c-9bf1-38ccf92b19ad@googlegroups.com> <jqmnk0$2jm$1@dont-email.me>

Show all headers | View raw


Knute Johnson wrote:
> Lew wrote:
>> John B. Matthews wrote:
>>> This reminds of an example adduced by Knute Johnson:
>>>
>>> <https://groups.google.com/d/msg/comp.lang.java.gui/aBy_DZFvg2M/-T9aWOwBM-QJ>
>>
>> Ten points for using the word "adduced".
>>
>> There are some EDT violations in the cited code's 'main()' routine.
>>
>
> Here's the updated code with that fixed.
>
> import java.awt.*;
> import java.awt.event.*;
> import java.awt.geom.*;
> import java.awt.image.*;
> import java.lang.reflect.*;
> import javax.swing.*;
>
> public class test3 extends JPanel implements Runnable {
>     volatile BufferedImage bi;
>     volatile long then;

I am curious what motivated the choice of 'volatile'.

In my own case I will sometimes speculatively use 'volatile' to mark fields 
not essential to state despite that the class does not implement 
'Serializable'. While this violates the rigid rule prohibiting superfluity, I 
aver that the marker aids reasoning about the state in such cases.

This doesn't seem to be that.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: a tight game loop in Swing "John B. Matthews" <nospam@nospam.invalid> - 2012-06-04 11:01 -0400
  Re: a tight game loop in Swing Lew <lewbloch@gmail.com> - 2012-06-04 16:39 -0700
    Re: a tight game loop in Swing Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2012-06-05 21:51 -0700
      Re: a tight game loop in Swing Lew <noone@lewscanon.com> - 2012-06-06 23:58 -0700
        Re: a tight game loop in Swing Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-07 09:20 -0700
          Re: a tight game loop in Swing Lew <lewbloch@gmail.com> - 2012-06-08 12:28 -0700
      Re: a tight game loop in Swing Lew <noone@lewscanon.com> - 2012-06-07 00:36 -0700

csiph-web