Results 1 to 3 of 3
  1. #1
    sunilragidi is offline Member
    Join Date
    Dec 2010
    Posts
    1
    Rep Power
    0

    Smile Thread Execution

    Hi,

    I have 6 Java threads to perform specific tasks in 2 steps.

    step1: First 3 should only execute, other 3 should wait.
    step2: After step1 completes, other 3 threads should start execution.

    Can anyone pls tell how can I achieve this in Java....?

  2. #2
    demonick is offline Member
    Join Date
    Dec 2010
    Posts
    27
    Rep Power
    0

    Default

    make last 3 threads wait with, well, wait() method, when first three threads complete, invoke notifyAll(), which allows waiting threads to complete.

  3. #3
    Join Date
    Dec 2010
    Posts
    22
    Rep Power
    0

    Default

    why do you need thread to do this job? why cant first three threads handle the next three tasks too? I am just trying to understand the use case that may make your code complicated.

Similar Threads

  1. thread execution one after another
    By turanan in forum New To Java
    Replies: 16
    Last Post: 05-08-2012, 12:11 PM
  2. Replies: 10
    Last Post: 11-29-2010, 02:02 PM
  3. Regarding Applet Execution
    By makpandian in forum Java Applets
    Replies: 1
    Last Post: 03-13-2009, 12:49 PM
  4. JAR execution
    By patoh in forum New To Java
    Replies: 2
    Last Post: 11-26-2008, 09:09 AM
  5. Execution cut
    By Eric in forum Advanced Java
    Replies: 1
    Last Post: 06-27-2007, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •