Results 1 to 5 of 5
  1. #1
    jjjkkk is offline Member
    Join Date
    Jul 2011
    Posts
    4
    Rep Power
    0

    Default Thread Fundamentals

    Write a java program.
    Let's make a thread race program, where a ThreadRace class will create an instance of 10
    ThreadRaceCompetitor's. Then it'll run them all. Inside ThreadRaceCompetitor class, you
    should use, for example, Thread.sleep(generator.nextInt( 3000 )); to random the ability of
    each competitor. There will be also a results class called ThreadRaceContext, which will
    keep the scorecard of who finished in which place.

    When a ThreadCompetitor finishes the race, it will have to inform the
    ThreadRaceContext his race number, and that it's done, so the ThreadRaceContext will
    inform about its arrival. Who'll arrive first? Make your bets!
    Attached Thumbnails Attached Thumbnails Thread Fundamentals-map.jpg  
    Last edited by jjjkkk; 07-06-2011 at 07:12 PM.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,839
    Rep Power
    8

    Default

    Did you have a question?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    jjjkkk is offline Member
    Join Date
    Jul 2011
    Posts
    4
    Rep Power
    0

    Default

    This is a question. make a thread race program.

  4. #4
    Toll's Avatar
    Toll is offline Senior Member
    Join Date
    May 2011
    Location
    Sweden
    Posts
    384
    Rep Power
    4

    Default

    No, that's an assignment.

  5. #5
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,839
    Rep Power
    8

    Default

    Quote Originally Posted by jjjkkk View Post
    This is a question. make a thread race program.
    Nice try, but this isn't a homework service. Do your own work. See the link in my signature on asking smart questions.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Main Thread not waiting for grand child thread to finish
    By prashanthn in forum Threads and Synchronization
    Replies: 3
    Last Post: 06-07-2011, 09:26 AM
  2. Difference between Thread.yield() and Thread.sleep() methods
    By Nageswara Rao Mothukuri in forum New To Java
    Replies: 12
    Last Post: 07-30-2010, 05:37 PM
  3. Java Fundamentals training class in SF
    By Rooz in forum Java Software
    Replies: 0
    Last Post: 10-23-2009, 02:41 AM
  4. Replies: 0
    Last Post: 01-28-2008, 07:02 AM

Posting Permissions

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