1 Reply Latest reply on Nov 24, 2009 10:14 PM by 796447

    Threads waiting for each other

      I am developing a multi-threaded program. The thing is that I have a GUIThread and a XMLsettingsReaderThread (well among other threads).... Now it is absolutely necessary that the GUIThread is executed and completed to a certain level before the XMLsettingsReaderThread starts...Now how do I do this? The problem is that I want the GUIthread create a Frame first before XMLsettingsReaderThread starts cause it uses a getter on the Frame(created in GUIThread) and if XMLsettingsReaderThread is first then there is no frame yet so I get NullPointerException.

      thank you veeery much :)
        • 1. Re: Threads waiting for each other
          That's what the Object.wait() and Object.notify() methods are for, in conjunction with the synchronized keyword or block.
          I recommend you read the threading (concurrency) tutorial.