Starting from:

$30

Week 6 Assignment Solution

General Rules for Homework Assignments
• You are strongly encouraged to add comments throughout the program. Doing
so will help your facilitator to understand your programming logic and grade
you more accurately.
• You must work on your assignments individually. You are not allowed to copy
the answers from the others. However, you are encouraged to discuss the
approaches to the homework assignments with your section mates and the
facilitator in your section via the discussion board.
• Each assignment has a strict deadline. However, you are still allowed to submit
your assignment within 2 days after the deadline with a penalty. 15% of the
credit will be deducted unless you made previous arrangements with your
facilitator and professor. Assignments submitted 2 days after the deadline will
not be graded.
• When the term lastName is referenced in an assignment, please replace it with
your last name.

You are strongly encouraged to add comments into your program!

Given a large text file, the goal of this project is to count how many times each
alphabet character appears in the text file. The text file will be converted to
lowercase during the reading process. The program will create 26 threads. The
contents of text file read is shared between the 26 threads. The first thread will
count the number of a’s, the second thread will count the number of b’s, and so on.
All the threads also share a Results object. Each thread will contribute its own result to the shared Results objects.
Create a new Java Project in Eclipse named HW6_lastName and complete the
following requirements based on the Threads
Given a large text file, the goal of this project is to count how many times each alphabet character appears in the text file. The text file will be converted to lowercase during the reading process. The program will create 26 threads. The contents of text file read is shared between the 26 threads. The first thread will count the number of a’s, the second thread will count the number of b’s, and so on. All the threads also share a Results object. Each thread will contribute its own result to the shared Results objects. Create a new Java Project in Eclipse named HW6_lastName and complete the following requirements based on the Threads.

Part1 (100 points)

Create a package named cs520.hw6.part1. Using this package, create the following classes.

1. Create a class named ResultsEntry as follows: a. The instance private variables – count (int) and target (char) b. A single constructor with the two values c. Public get methods for the two variables d. Public toString method that returns a string in the format <target,count

2. Create a class named SharedResults as follows:

a. A private instance variable – results (ArrayList of ResultsEntry type)

b. A default constructor that initializes the above data structure.

c. A void addToResults method which takes the given ResultsEntry argument and adds it to the end of the shared results. This method then prints to the console the name of the current thread, the entry it added, and the shared results data structure. Handle the synchronization issue with this method.

d. The getResult method with no arguments which returns the sum of the count entry values in the shared results data structure. Handle the synchronization issue with this method.

3. Create a class named LongTask that extends the Thread class. a. The instance (or member) private variables – sharedData (of type SharedResults), inputData (of type StringBuffer), and target (of type char) b. A single constructor which takes the above three arguments and stores them in the instance values. Also, create a name for this thread as Thread_ c. In the run method, use a loop to go over char chacacter in the inputData and count the number of occurrences of target. After the loop is done, create a ResultsEntry object with this count and the target character, and invoke the addToResults method of the shared results object.

4. Create a Test class to test the following functionality in its main method. a. Using the P01_URLDemo as an example, read the contents of the URL (http://norvig.com/big.txt) into a StringBuffer object. After reading each line from the network, convert it to lower case and append to the StringBuffer. This will be the input data that is shared for each thread. b. Create the SharedResults object and assign it to a variable. c. Create 26 LongTask objects using an array of size 26. Each LongTask object is responsible to counting the occurrences of the characters ‘a’, ‘b’, ‘c’, …, ‘z’, respectively. Start the respective thread after creating each one. d. Wait for all the threads to complete using the join method e. Print the result from the shared object

Sample Output:

Different runs of the program will produce the output in different sequences, but the final result would be the same. Input Data length: 6488666 Thread Thread_a running Thread Thread_b running Thread Thread_c running Thread Thread_d running Thread Thread_e running Thread Thread_f running Thread Thread_g running Thread Thread_h running Thread Thread_i running Thread Thread_j running Thread Thread_k running Thread Thread_l running Thread Thread_m running Thread Thread_n running Thread Thread_o running Thread Thread_p running Thread Thread_q running Thread Thread_r running Thread Thread_s running Thread Thread_t running Thread Thread_u running Thread Thread_v running Thread Thread_w running Thread Thread_x running Thread Thread_y running Thread Thread_z running Thread_k is adding <k, 32798="", Cumulative Results are [<k, 32798=""] Thread_l is adding <l, 198648="", Cumulative Results are [<k, 32798="", <l, 198648=""] Thread_g is adding <g, 96916="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916=""] Thread_t is adding <t, 460741="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741=""] Thread_d is adding <d, 215706="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706=""] Thread_a is adding <a, 408089="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089=""] Thread_m is adding <m, 127063="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063=""] Thread_e is adding <e, 633818="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818=""] Thread_z is adding <z, 3796="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796=""] Thread_s is adding <s, 334897="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897=""] Thread_y is adding <y, 90481="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481=""] Thread_c is adding <c, 144972="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972=""] Thread_h is adding <h, 294681="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681=""] Thread_f is adding <f, 120875="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875=""] Thread_b is adding <b, 73168="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875="", <b, 73168=""] Thread_n is adding <n, 369018="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875="", <b, 73168="", <n, 369018=""] Thread_x is adding <x, 9810="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875="", <b, 73168="", <n, 369018="", <x, 9810=""] Thread_w is adding <w, 100831="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875="", <b, 73168="", <n, 369018="", <x, 9810="", <w, 100831=""] Thread_p is adding <p, 98913="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875="", <b, 73168="", <n, 369018="", <x, 9810="", <w, 100831="", <p, 98913=""] Thread_r is adding <r, 309555="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875="", <b, 73168="", <n, 369018="", <x, 9810="", <w, 100831="", <p, 98913="", <r, 309555=""] Thread_v is adding <v, 52378="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875="", <b, 73168="", <n, 369018="", <x, 9810="", <w, 100831="", <p, 98913="", <r, 309555="", <v, 52378=""] Thread_u is adding <u, 138732="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875="", <b, 73168="", <n, 369018="", <x, 9810="", <w, 100831="", <p, 98913="", <r, 309555="", <v, 52378="", <u, 138732=""] Thread_q is adding <q, 4571="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875="", <b, 73168="", <n, 369018="", <x, 9810="", <w, 100831="", <p, 98913="", <r, 309555="", <v, 52378="", <u, 138732="", <q, 4571=""] Thread_i is adding <i, 365638="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875="", <b, 73168="", <n, 369018="", <x, 9810="", <w, 100831="", <p, 98913="", <r, 309555="", <v, 52378="", <u, 138732="", <q, 4571="", <i, 365638=""] Thread_j is adding <j, 6436="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875="", <b, 73168="", <n, 369018="", <x, 9810="", <w, 100831="", <p, 98913="", <r, 309555="", <v, 52378="", <u, 138732="", <q, 4571="", <i, 365638="", <j, 6436=""] Thread_o is adding <o, 386867="", Cumulative Results are [<k, 32798="", <l, 198648="", <g, 96916="", <t, 460741="", <d, 215706="", <a, 408089="", <m, 127063="", <e, 633818="", <z, 3796="", <s, 334897="", <y, 90481="", <c, 144972="", <h, 294681="", <f, 120875="", <b, 73168="", <n, 369018="", <x, 9810="", <w, 100831="", <p, 98913="", <r, 309555="", <v, 52378="", <u, 138732="", <q, 4571="", <i, 365638="", <j, 6436="", <o, 386867=""] Alphabet Count = 5079398




Part2 (Optional Extra Credit 25 Points)

Create a package named cs520.hw6.part2. Modify the above program using the wait/notifyAll features. When a thread tries to contribute its results to the shared data, and if it is not this thread’s turn, it has to wait. When it is the thread’s turn, its contributing result is added to the shared results and all other threads are notified. Thread_a will be first, Thread_b will be second, and so on. Suggested modifications to Part1 code are shown below.

1.SharedResults class

a. addToResults method takes two arguments, the calling thread’s turn and the contributing result that needs to be added to the shared results. Implement the wait and notifyAll functionality in this method. Print to the console the thread’s turn, the name of the current thread, the value it added, and the shared results data structure. Handle the synchronization issue with this method. Use the size of the data structure to determine if it is the calling thread’s turn.

2. LongTask class a. Add the turn (integer) instance variable b. Modify the constructor to take care of this additional argument. c.In the run method, after the loop of computation is done, invoke the addToResults method of the shared object and provide this thread’s turn and its this accumulated ResultsEntry.

3. Test class Provide the turn for each LongTask thread when invoking the constructor. Thread_a’s turn is 0, Thread_b’s turn is 1, and so on.

Sample Output:

Input Data length: 6488666 Thread Thread_a - Turn 0 Thread Thread_b - Turn 1 Thread Thread_c - Turn 2 Thread Thread_d - Turn 3 Thread Thread_e - Turn 4 Thread Thread_f - Turn 5 Thread Thread_g - Turn 6 Thread Thread_h - Turn 7 Thread Thread_i - Turn 8 Thread Thread_j - Turn 9 Thread Thread_k - Turn 10 Thread Thread_l - Turn 11 Thread Thread_m - Turn 12 Thread Thread_n - Turn 13 Thread Thread_o - Turn 14 Thread Thread_p - Turn 15 Thread Thread_q - Turn 16 Thread Thread_r - Turn 17 Thread Thread_s - Turn 18 Thread Thread_t - Turn 19 Thread Thread_u - Turn 20 Thread Thread_v - Turn 21 Thread Thread_w - Turn 22 Thread Thread_x - Turn 23 Thread Thread_y - Turn 24 Thread Thread_z - Turn 25 Calling Thread's Turn 16, WhoseTurn 0 ... Wait Calling Thread's Turn 9, WhoseTurn 0 ... Wait Calling Thread's Turn 3, WhoseTurn 0 ... Wait Calling Thread's Turn 25, WhoseTurn 0 ... Wait Calling Thread's Turn 22, WhoseTurn 0 ... Wait Calling Thread's Turn 13, WhoseTurn 0 ... Wait Calling Thread's Turn 7, WhoseTurn 0 ... Wait Calling Thread's Turn 19, WhoseTurn 0 ... Wait Calling Thread's Turn 23, WhoseTurn 0 ... Wait Calling Thread's Turn 8, WhoseTurn 0 ... Wait Calling Thread's Turn 4, WhoseTurn 0 ... Wait Calling Thread's Turn 11, WhoseTurn 0 ... Wait Calling Thread's Turn 21, WhoseTurn 0 ... Wait Calling Thread's Turn 20, WhoseTurn 0 ... Wait Calling Thread's Turn 14, WhoseTurn 0 ... Wait Calling Thread's Turn 17, WhoseTurn 0 ... Wait Calling Thread's Turn 24, WhoseTurn 0 ... Wait Calling Thread's Turn 1, WhoseTurn 0 ... Wait Calling Thread's Turn 10, WhoseTurn 0 ... Wait Calling Thread's Turn 5, WhoseTurn 0 ... Wait Calling Thread's Turn 15, WhoseTurn 0 ... Wait Calling Thread's Turn 2, WhoseTurn 0 ... Wait Calling Thread's Turn 12, WhoseTurn 0 ... Wait Calling Thread's Turn 18, WhoseTurn 0 ... Wait Calling Thread's Turn 6, WhoseTurn 0 ... Wait Calling Thread's Turn 0, Thread_a is adding <a, 408089="", Cumulative Result is [<a, 408089=""] Calling Thread's Turn 6, WhoseTurn 1 ... Wait Calling Thread's Turn 18, WhoseTurn 1 ... Wait Calling Thread's Turn 12, WhoseTurn 1 ... Wait Calling Thread's Turn 2, WhoseTurn 1 ... Wait Calling Thread's Turn 15, WhoseTurn 1 ... Wait Calling Thread's Turn 5, WhoseTurn 1 ... Wait Calling Thread's Turn 10, WhoseTurn 1 ... Wait Calling Thread's Turn 1, Thread_b is adding <b, 73168="", Cumulative Result is [<a, 408089="", <b, 73168=""] Calling Thread's Turn 24, WhoseTurn 2 ... Wait Calling Thread's Turn 17, WhoseTurn 2 ... Wait Calling Thread's Turn 14, WhoseTurn 2 ... Wait Calling Thread's Turn 20, WhoseTurn 2 ... Wait Calling Thread's Turn 21, WhoseTurn 2 ... Wait Calling Thread's Turn 11, WhoseTurn 2 ... Wait Calling Thread's Turn 4, WhoseTurn 2 ... Wait Calling Thread's Turn 8, WhoseTurn 2 ... Wait Calling Thread's Turn 23, WhoseTurn 2 ... Wait Calling Thread's Turn 19, WhoseTurn 2 ... Wait Calling Thread's Turn 7, WhoseTurn 2 ... Wait Calling Thread's Turn 13, WhoseTurn 2 ... Wait Calling Thread's Turn 22, WhoseTurn 2 ... Wait Calling Thread's Turn 25, WhoseTurn 2 ... Wait Calling Thread's Turn 3, WhoseTurn 2 ... Wait Calling Thread's Turn 9, WhoseTurn 2 ... Wait Calling Thread's Turn 16, WhoseTurn 2 ... Wait Calling Thread's Turn 10, WhoseTurn 2 ... Wait Calling Thread's Turn 5, WhoseTurn 2 ... Wait Calling Thread's Turn 15, WhoseTurn 2 ... Wait Calling Thread's Turn 2, Thread_c is adding <c, 144972="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972=""] Calling Thread's Turn 12, WhoseTurn 3 ... Wait Calling Thread's Turn 18, WhoseTurn 3 ... Wait Calling Thread's Turn 6, WhoseTurn 3 ... Wait Calling Thread's Turn 15, WhoseTurn 3 ... Wait Calling Thread's Turn 5, WhoseTurn 3 ... Wait Calling Thread's Turn 10, WhoseTurn 3 ... Wait Calling Thread's Turn 16, WhoseTurn 3 ... Wait Calling Thread's Turn 9, WhoseTurn 3 ... Wait Calling Thread's Turn 3, Thread_d is adding <d, 215706="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706=""] Calling Thread's Turn 25, WhoseTurn 4 ... Wait Calling Thread's Turn 22, WhoseTurn 4 ... Wait Calling Thread's Turn 13, WhoseTurn 4 ... Wait Calling Thread's Turn 7, WhoseTurn 4 ... Wait Calling Thread's Turn 19, WhoseTurn 4 ... Wait Calling Thread's Turn 23, WhoseTurn 4 ... Wait Calling Thread's Turn 8, WhoseTurn 4 ... Wait Calling Thread's Turn 4, Thread_e is adding <e, 633818="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818=""] Calling Thread's Turn 11, WhoseTurn 5 ... Wait Calling Thread's Turn 21, WhoseTurn 5 ... Wait Calling Thread's Turn 20, WhoseTurn 5 ... Wait Calling Thread's Turn 14, WhoseTurn 5 ... Wait Calling Thread's Turn 17, WhoseTurn 5 ... Wait Calling Thread's Turn 24, WhoseTurn 5 ... Wait Calling Thread's Turn 8, WhoseTurn 5 ... Wait Calling Thread's Turn 23, WhoseTurn 5 ... Wait Calling Thread's Turn 19, WhoseTurn 5 ... Wait Calling Thread's Turn 7, WhoseTurn 5 ... Wait Calling Thread's Turn 13, WhoseTurn 5 ... Wait Calling Thread's Turn 22, WhoseTurn 5 ... Wait Calling Thread's Turn 25, WhoseTurn 5 ... Wait Calling Thread's Turn 9, WhoseTurn 5 ... Wait Calling Thread's Turn 16, WhoseTurn 5 ... Wait Calling Thread's Turn 10, WhoseTurn 5 ... Wait Calling Thread's Turn 5, Thread_f is adding <f, 120875="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875=""] Calling Thread's Turn 15, WhoseTurn 6 ... Wait Calling Thread's Turn 6, Thread_g is adding <g, 96916="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916=""] Calling Thread's Turn 18, WhoseTurn 7 ... Wait Calling Thread's Turn 12, WhoseTurn 7 ... Wait Calling Thread's Turn 15, WhoseTurn 7 ... Wait Calling Thread's Turn 10, WhoseTurn 7 ... Wait Calling Thread's Turn 16, WhoseTurn 7 ... Wait Calling Thread's Turn 9, WhoseTurn 7 ... Wait Calling Thread's Turn 25, WhoseTurn 7 ... Wait Calling Thread's Turn 22, WhoseTurn 7 ... Wait Calling Thread's Turn 13, WhoseTurn 7 ... Wait Calling Thread's Turn 7, Thread_h is adding <h, 294681="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681=""] Calling Thread's Turn 19, WhoseTurn 8 ... Wait Calling Thread's Turn 23, WhoseTurn 8 ... Wait Calling Thread's Turn 8, Thread_i is adding <i, 365638="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638=""] Calling Thread's Turn 24, WhoseTurn 9 ... Wait Calling Thread's Turn 17, WhoseTurn 9 ... Wait Calling Thread's Turn 14, WhoseTurn 9 ... Wait Calling Thread's Turn 20, WhoseTurn 9 ... Wait Calling Thread's Turn 21, WhoseTurn 9 ... Wait Calling Thread's Turn 11, WhoseTurn 9 ... Wait Calling Thread's Turn 23, WhoseTurn 9 ... Wait Calling Thread's Turn 19, WhoseTurn 9 ... Wait Calling Thread's Turn 13, WhoseTurn 9 ... Wait Calling Thread's Turn 22, WhoseTurn 9 ... Wait Calling Thread's Turn 25, WhoseTurn 9 ... Wait Calling Thread's Turn 9, Thread_j is adding <j, 6436="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436=""] Calling Thread's Turn 16, WhoseTurn 10 ... Wait Calling Thread's Turn 10, Thread_k is adding <k, 32798="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798=""] Calling Thread's Turn 15, WhoseTurn 11 ... Wait Calling Thread's Turn 12, WhoseTurn 11 ... Wait Calling Thread's Turn 18, WhoseTurn 11 ... Wait Calling Thread's Turn 16, WhoseTurn 11 ... Wait Calling Thread's Turn 25, WhoseTurn 11 ... Wait Calling Thread's Turn 22, WhoseTurn 11 ... Wait Calling Thread's Turn 13, WhoseTurn 11 ... Wait Calling Thread's Turn 19, WhoseTurn 11 ... Wait Calling Thread's Turn 23, WhoseTurn 11 ... Wait Calling Thread's Turn 11, Thread_l is adding <l, 198648="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648=""] Calling Thread's Turn 21, WhoseTurn 12 ... Wait Calling Thread's Turn 20, WhoseTurn 12 ... Wait Calling Thread's Turn 14, WhoseTurn 12 ... Wait Calling Thread's Turn 17, WhoseTurn 12 ... Wait Calling Thread's Turn 24, WhoseTurn 12 ... Wait Calling Thread's Turn 23, WhoseTurn 12 ... Wait Calling Thread's Turn 19, WhoseTurn 12 ... Wait Calling Thread's Turn 13, WhoseTurn 12 ... Wait Calling Thread's Turn 22, WhoseTurn 12 ... Wait Calling Thread's Turn 25, WhoseTurn 12 ... Wait Calling Thread's Turn 16, WhoseTurn 12 ... Wait Calling Thread's Turn 18, WhoseTurn 12 ... Wait Calling Thread's Turn 12, Thread_m is adding <m, 127063="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063=""] Calling Thread's Turn 15, WhoseTurn 13 ... Wait Calling Thread's Turn 18, WhoseTurn 13 ... Wait Calling Thread's Turn 16, WhoseTurn 13 ... Wait Calling Thread's Turn 25, WhoseTurn 13 ... Wait Calling Thread's Turn 22, WhoseTurn 13 ... Wait Calling Thread's Turn 13, Thread_n is adding <n, 369018="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018=""] Calling Thread's Turn 19, WhoseTurn 14 ... Wait Calling Thread's Turn 23, WhoseTurn 14 ... Wait Calling Thread's Turn 24, WhoseTurn 14 ... Wait Calling Thread's Turn 17, WhoseTurn 14 ... Wait Calling Thread's Turn 14, Thread_o is adding <o, 386867="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018="", <o, 386867=""] Calling Thread's Turn 20, WhoseTurn 15 ... Wait Calling Thread's Turn 21, WhoseTurn 15 ... Wait Calling Thread's Turn 17, WhoseTurn 15 ... Wait Calling Thread's Turn 24, WhoseTurn 15 ... Wait Calling Thread's Turn 23, WhoseTurn 15 ... Wait Calling Thread's Turn 19, WhoseTurn 15 ... Wait Calling Thread's Turn 22, WhoseTurn 15 ... Wait Calling Thread's Turn 25, WhoseTurn 15 ... Wait Calling Thread's Turn 16, WhoseTurn 15 ... Wait Calling Thread's Turn 18, WhoseTurn 15 ... Wait Calling Thread's Turn 15, Thread_p is adding <p, 98913="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018="", <o, 386867="", <p, 98913=""] Calling Thread's Turn 18, WhoseTurn 16 ... Wait Calling Thread's Turn 16, Thread_q is adding <q, 4571="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018="", <o, 386867="", <p, 98913="", <q, 4571=""] Calling Thread's Turn 25, WhoseTurn 17 ... Wait Calling Thread's Turn 22, WhoseTurn 17 ... Wait Calling Thread's Turn 19, WhoseTurn 17 ... Wait Calling Thread's Turn 23, WhoseTurn 17 ... Wait Calling Thread's Turn 24, WhoseTurn 17 ... Wait Calling Thread's Turn 17, Thread_r is adding <r, 309555="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018="", <o, 386867="", <p, 98913="", <q, 4571="", <r, 309555=""] Calling Thread's Turn 21, WhoseTurn 18 ... Wait Calling Thread's Turn 20, WhoseTurn 18 ... Wait Calling Thread's Turn 24, WhoseTurn 18 ... Wait Calling Thread's Turn 23, WhoseTurn 18 ... Wait Calling Thread's Turn 19, WhoseTurn 18 ... Wait Calling Thread's Turn 22, WhoseTurn 18 ... Wait Calling Thread's Turn 25, WhoseTurn 18 ... Wait Calling Thread's Turn 18, Thread_s is adding <s, 334897="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018="", <o, 386867="", <p, 98913="", <q, 4571="", <r, 309555="", <s, 334897=""] Calling Thread's Turn 25, WhoseTurn 19 ... Wait Calling Thread's Turn 22, WhoseTurn 19 ... Wait Calling Thread's Turn 19, Thread_t is adding <t, 460741="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018="", <o, 386867="", <p, 98913="", <q, 4571="", <r, 309555="", <s, 334897="", <t, 460741=""] Calling Thread's Turn 23, WhoseTurn 20 ... Wait Calling Thread's Turn 24, WhoseTurn 20 ... Wait Calling Thread's Turn 20, Thread_u is adding <u, 138732="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018="", <o, 386867="", <p, 98913="", <q, 4571="", <r, 309555="", <s, 334897="", <t, 460741="", <u, 138732=""] Calling Thread's Turn 21, Thread_v is adding <v, 52378="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018="", <o, 386867="", <p, 98913="", <q, 4571="", <r, 309555="", <s, 334897="", <t, 460741="", <u, 138732="", <v, 52378=""] Calling Thread's Turn 24, WhoseTurn 22 ... Wait Calling Thread's Turn 23, WhoseTurn 22 ... Wait Calling Thread's Turn 22, Thread_w is adding <w, 100831="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018="", <o, 386867="", <p, 98913="", <q, 4571="", <r, 309555="", <s, 334897="", <t, 460741="", <u, 138732="", <v, 52378="", <w, 100831=""] Calling Thread's Turn 25, WhoseTurn 23 ... Wait Calling Thread's Turn 23, Thread_x is adding <x, 9810="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018="", <o, 386867="", <p, 98913="", <q, 4571="", <r, 309555="", <s, 334897="", <t, 460741="", <u, 138732="", <v, 52378="", <w, 100831="", <x, 9810=""] Calling Thread's Turn 24, Thread_y is adding <y, 90481="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018="", <o, 386867="", <p, 98913="", <q, 4571="", <r, 309555="", <s, 334897="", <t, 460741="", <u, 138732="", <v, 52378="", <w, 100831="", <x, 9810="", <y, 90481=""] Calling Thread's Turn 25, Thread_z is adding <z, 3796="", Cumulative Result is [<a, 408089="", <b, 73168="", <c, 144972="", <d, 215706="", <e, 633818="", <f, 120875="", <g, 96916="", <h, 294681="", <i, 365638="", <j, 6436="", <k, 32798="", <l, 198648="", <m, 127063="", <n, 369018="", <o, 386867="", <p, 98913="", <q, 4571="", <r, 309555="", <s, 334897="", <t, 460741="", <u, 138732="", <v, 52378="", <w, 100831="", <x, 9810="", <y, 90481="", <z, 3796=""] Alphabet Count = 5079398

More products