P
Philipp Kraus
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
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