B C G M P Q R S T

B

BatonMessageBox<V> - Class in threadExamples
Implements a message box which can hold only a single message at a time.
BatonMessageBox() - Constructor for class threadExamples.BatonMessageBox
Creates an empty BatonMessageBox.

C

Channel<V,W> - Class in threadExamples
A pair of Queues, representing a two-way channel between Threads.
Channel() - Constructor for class threadExamples.Channel
Creates a new Channel (a pair of Queues).
Counter - Class in threadExamples
This class illustrates the use of a Channel (a pair of Queues) to provide two-way communication between Threads.
Counter(Channel<?, Integer>, int) - Constructor for class threadExamples.Counter
Creates a Counter.

G

get() - Method in class threadExamples.BatonMessageBox
Waits until there is something in this BatonMessageBox, then removes and returns it.
get() - Method in class threadExamples.Queue
Returns an Object from this Queue, waiting indefinitely if necessary for something to be put in this Queue.
get(int) - Method in class threadExamples.Queue
Returns an Object from this Queue, waiting up to limit milliseconds, if necessary, for something to be put into this Queue.
get() - Method in class threadExamples.SingleMessageBox
Waits until there is a "message" of type V in this SingleMessageBox, then removes and returns it.
getRequest() - Method in class threadExamples.Channel
Gets an Object of type V from the request queue.
getResponse() - Method in class threadExamples.Channel
Gets an Object of type W from the response queue.

M

Main - Class in threadExamples
This program demonstrates three ways to keep Threads in sync.
Main() - Constructor for class threadExamples.Main
 
main(String[]) - Static method in class threadExamples.Main
Demonstration program to synchronize two Threads--one counting from 1 to 10, the other counting by tens from 10 to 100--in three different ways.

P

Producer - Class in threadExamples
Once started, a Producer will unilaterally start producing numbers (using the increment with which it is started).
Producer(SingleMessageBox<Integer>, int) - Constructor for class threadExamples.Producer
Constructs a Producer that communicates by means of a SingleMessageBox, and produces values that count up by the given increment.
Producer(BatonMessageBox<Integer>, int) - Constructor for class threadExamples.Producer
Constructs a Producer that communicates by means of a BatonMessageBox, and produces values that count up by the given increment.
put(V) - Method in class threadExamples.BatonMessageBox
Waits until this BatonMessageBox is empty, then puts the given object into it.
put(V) - Method in class threadExamples.Queue
Adds an object to this Queue.
put(V) - Method in class threadExamples.SingleMessageBox
Waits until this SingleMessageBox is empty, then puts the given "message" of type V into it.
putRequest(V) - Method in class threadExamples.Channel
Puts an Object of type V into the request queue.
putResponse(W) - Method in class threadExamples.Channel
Puts an object of type W into the response queue.

Q

Queue<V> - Class in threadExamples
A synchronized queue.
Queue() - Constructor for class threadExamples.Queue
 

R

randomDelay() - Static method in class threadExamples.Counter
Pauses a random amount of time.
run() - Method in class threadExamples.Counter
When a request is received (via the request queue of a Channel), then after a random delay, a response (an incremented number) is produced and returned (via the response queue of the same Channel).
run() - Method in class threadExamples.Producer
Continuously counts up (with a random delay) and puts the next number into a message box, if the message box is available (empty).

S

SingleMessageBox<V> - Class in threadExamples
Implements a message box which can hold only a single message at a time.
SingleMessageBox() - Constructor for class threadExamples.SingleMessageBox
Creates an empty SingleMessageBox.

T

threadExamples - package threadExamples
 

B C G M P Q R S T