Search:

Type: Posts; User: Norm

Search: Search took 0.08 seconds.

  1. Replies
    14
    Views
    1,504

    Re: Thread synchronisation help!

    Can you explain what is missing?


    The order of the output shows the order the statements were executed in. Which thread gets execution will depend on which one is ready to execute and also on...
  2. Replies
    14
    Views
    1,504

    Re: Thread synchronisation help!

    The println does not say what object it is in (each has a unique num value)
    and does not print when the method begins - add another println at the beginning of the method so you see when the method...
  3. Replies
    14
    Views
    1,504

    Re: Thread synchronisation help!

    When the class extends Thread, setPriority() is in the Thread class and the code should now compile.

    Try doing some debugging by adding some println methods to show when the methods are executed...
  4. Replies
    14
    Views
    1,504

    Re: Thread synchronisation help!

    That may be the right method to use. You need to get a reference to the thread that is executing so you can change its priority.

    Using Threads this way is tricky. I'm not sure you will get the...
  5. Replies
    14
    Views
    1,504

    Re: Thread synchronisation help!

    How does creating a thread and setting its priority change the priority of the thread that is executing the method? If you want to change the priority of the thread for the executing method, you...
  6. Replies
    14
    Views
    1,504

    Re: Thread synchronisation help!

    An interface does not define methods. When a class implements an interface, the class is required to define(provide code for) all the methods defined in the interface....
  7. Replies
    14
    Views
    1,504

    Re: Thread synchronisation help!

    Where is the setPriority() method defined? It looks like the compiler can not find its definition in the class where it is used.
Results 1 to 7 of 7