Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Replies
    12
    Views
    5,663

    Re: How Can I run java threads

    wait and notify must be called on THE SAME EXACT OBJECT.
    To coordinate two threads using wait and notify, they must use one object.

    You'll need an object for each case where a thread has to wait...
  2. Replies
    12
    Views
    5,663

    Re: How Can I run java threads

    The wait and the notify should be on the same object. Your code shows different objects.

    Read the API doc for those methods.
  3. Replies
    12
    Views
    5,663

    Re: How Can I run java threads

    They will continue to execute if they don't return from the run() method.


    Which thread? The one that is waiting for more data in the linked list or the one that has just added to the list?
  4. Replies
    12
    Views
    5,663

    Re: How Can I run java threads

    What do you want the code to do?

    What does the API doc say about calling start() and run() more than once?
Results 1 to 4 of 4