shiva
shiva

Reputation: 11

java multithread reading..please help im very new to java:(

Program that demonstrates the use of multithread reading with the use of three counters with three threads defined for each. Thus threads should represent the counters as follows:

  1. One counter starts from 5 and increments with the step of 5.
  2. Second counter starts from 10 and increments with the step of 10.
  3. Third counter starts with 100 and increments with the step of 100.
  4. Assign proper priority to the threads and then run the threads.

Upvotes: 0

Views: 632

Answers (4)

Peter Lawrey
Peter Lawrey

Reputation: 533780

I suggest you create an ExecutorService and add three tasks to the service with one loop for each task. I could give you an answer, but unless you do some investigation yourself, you won't understand it.

Upvotes: 0

Aravind Yarram
Aravind Yarram

Reputation: 80194

The question is not clear but since this is a homework, I will just give hints

  1. Read the multi-threading tutorial first
  2. thread priorities may not show the same behavior across OS's

Upvotes: 2

maerics
maerics

Reputation: 156592

The Java Tutorial Concurrency Lesson is a great place to start learning about multithreading.

Upvotes: 2

Matten
Matten

Reputation: 17603

Even if you're very new to java, it should be easy to use google to get a idea how this problem can be solved, it's not very complicated.

Just have a look at this example about threading, it was the first hit. Check out the table of contents on javabeginner.com to learn more, I really recommend it to you.

Upvotes: 2

Related Questions