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


Groups > comp.lang.java.programmer > #28452

threadpool and ui paint

From Philipp Kraus <philipp.kraus@flashpixx.de>
Newsgroups comp.lang.java.programmer
Subject threadpool and ui paint
Date 2014-05-13 09:35 +0200
Organization Clausthal University of Technology
Message-ID <lkshvd$143g$1@ariadne.rz.tu-clausthal.de> (permalink)

Show all headers | View raw


Hello,

I have a lot of objects, which are calculated within a thread pool (by 
a queue structure), so each object
as got an individual paint method for visualization. At the moment I 
try to paint the objects within the threads
of the pool, but this creates exceptions.

Which is the correct way to do an UI painting? Each object needs an 
individual paint structure, but all objects
can be painted after the thread has calculated the objects. In pseudo 
code my structure shows:

class worker {
    void run()
    {

     while (threadruns)
     {
          for all x = get object from queue
          {
             calculate x
             push x back to the finish queue
             - paint x -
          }
          - or here paint x -

          thread await

          for all y = ….
     }

}

I'm a little bit confused with the Swing InvoceLater structure and in 
which way I can imlemented this in my pool

Thanks

Phil

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

threadpool and ui paint Philipp Kraus <philipp.kraus@flashpixx.de> - 2014-05-13 09:35 +0200
  Re: threadpool and ui paint Joerg Meier <joergmmeier@arcor.de> - 2014-05-13 11:26 +0200
    Re: threadpool and ui paint markspace <markspace@nospam.nospam> - 2014-05-13 09:35 -0700
  Re: threadpool and ui paint Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-05-13 08:10 -0400
    Re: threadpool and ui paint markspace <markspace@nospam.nospam> - 2014-05-13 09:45 -0700
      Re: threadpool and ui paint Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-05-13 13:22 -0400
        Re: threadpool and ui paint markspace <markspace@nospam.nospam> - 2014-05-13 10:46 -0700

csiph-web