• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple Threads - runnable, join and yield.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm to change someone elses code and having trouble understanding it.
Runnable is used since the GeneralForm is extended by many classes.
This is simplified excerpts.
5 Questions; 1-4 on THE CODE below, then 5 a further complication.
Basically trying to decide if threads complete or whether other action on screen interrupts them
(action before dialogs appear; or action on dialogs).

1) What is the thread.join() joining to?
Eg. Does thread1.join() force the current thread to remain active until thread1 is done?
2) waitDialog.waitForShow is part of the findRecord thread. Am I correct that the findRecord method may not be complete when waitForShow begins?
ie. In waitForShow,
Thread.currentThread().yield();
will allow findRecord to continue.

3) However, what is the effect of in waitDialog.waitForShow, of:
animation.stopAnimation()
which has a thread.join()?
In the case below, animation thread has a join. Does the code force the animation to continue until the findRecord thread is complete?
(findRecord completion is by process completion or CANCEL_PRESSED)

4) Is the animation guaranteed to run?
What if person clicks on screen starting other actions.

THE CODE:

QUESTION 5) Of course, to complicate things more, classes extending GeneralForm also have threads in an overridden method. This new class's addRecord method should complete as a unit. Wondering if at the "***" we should be using thread.join()?Or is threadGroup somehow involved. Or should a new thread simply not be started here at all?
(This new thread was introduced by us since data results suggested the interface was not completing.)
Use of priorities would not be exclusively effective since we are in a timeslicing environment.

[This message has been edited by Marilyn deQueiroz (edited September 08, 2001).]
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

QUESTION 5) Of course, to complicate things more, classes extending GeneralForm also have threads in an overridden method. This new class's addRecord method should complete as a unit. Wondering if at the "***" we should be using thread.join()?Or is threadGroup somehow involved. Or should a new thread simply not be started here at all?
(This new thread was introduced by us since data results suggested the interface was not completing.)
Use of priorities would not be exclusively effective since we are in a timeslicing environment.


[This message has been edited by Marilyn deQueiroz (edited September 12, 2001).]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic