Search:

Type: Posts; User: Miths

Search: Search took 0.32 seconds.

  1. Thread: Multithreading

    by Miths
    Replies
    10
    Views
    503

    Re: Multithreading

    Just added a for loop for each thread so that it performs some action for a while.


    class B extends Thread {
    public void run() {
    for(int i = 0; i<100; i++){
    System.out.println("Thread...
  2. Thread: Multithreading

    by Miths
    Replies
    10
    Views
    503

    Re: Multithreading

    ThreadC has got maximum priority which is 10, so it has to be processed at first. [ threadC.setPriority(Thread.MAX_PRIORITY); ]
    ThreadB has priority which is in between ThreadA and threadC. [...
  3. Thread: Multithreading

    by Miths
    Replies
    10
    Views
    503

    Re: Multithreading

    My Question is, The thread which is been set to MAX_PRIORITY has to be executed first and thread which has LOW_PRIORITY has to be executed last but it's not working so.

    Code:


    package first;
    ...
  4. Thread: Multithreading

    by Miths
    Replies
    10
    Views
    503

    Re: Multithreading

    Just now realized the working of join() method. But still setPriority() is a bit confusing me.

    INPUT:

    threadC.setPriority(Thread.MAX_PRIORITY);
    threadB.setPriority(threadA.getPriority() +...
  5. Thread: Multithreading

    by Miths
    Replies
    10
    Views
    503

    Multithreading

    I have a question regarding join(),setPriority() methods. How we can I see the working of these methods?. I could not get the reality in windows OS when i coded in java. Is it due to Windows is...
  6. Thread: Hi

    by Miths
    Replies
    1
    Views
    195

    Hi

    It's nice to register with Java Programming forums
Results 1 to 6 of 6