Not completed, Sunday One will be completed
- Summary of this week's study
1.1 Summarize multithreading related content in the way you like (mind map or other).
- Written work
Multi-thread of this PTA job title set
- Source code reading: Multi-threaded Bouncethread
What is the use of the 1.1 ballrunnable class? Why do I need to call Thread.Sleep to hibernate in my code?
1.2 Ball.java only do two things, what are the two things respectively? What does the Ballcomponent object do? What is the use of the ArrayList inside? How many ballcomponent objects are generated during the program run? The program uses multithreading techniques, each of which is drawn in separate threads?
1.3 Choose: Program rewrite: When the program runs, each ball is from a fixed position. How do you rewrite the program so that when you click Start, each ball can be moved from a different position, with a different step?
1.4 Choose: The trajectory of the different balls is exactly the same. The transformation process, so that each small ball trajectory is not exactly the same, for example, some can take the cosine trajectory, some can go square wave trajectory, some go Brownian motion, some go pentagram, and so on.
- Experiment Summary: Problem sets (multithreading)
2.1 Topics: Thread, Printtask, runnable, and anonymous inner classes.
and answer: A) What is the benefit of implementing multithreaded programs by defining the implementation class of the Runnable interface than by inheriting from the thread class? b) 6-1,6-3,6-11 experimental summary.
2.2 Using a lambda expression to overwrite 6-3
2.3 Title: 6-2 (runnable and stop thread). Answer: How do I need to properly stop a running thread?
2.4 Selected: 6-8 (countdownlatch) Experiment Summary
2.5 Select: 6-9 (set synchronization problem) experimental summary
2.6 Choose: More difficult: 6-10 (callable), and answer why Runnable need callable? Experimental summary.
- Mutually exclusive access
3.1 Modify the Testunsynchronizedthread.java source code so that it can be accessed synchronously. (Key code, need to appear number)
3.2 Optional: Further use of the actuator to improve the corresponding code (key code, need to appear number)
Reference: Java multi-thread executor, Executorservice, executors, callable, future and Futuretask
- Mutually exclusive access and synchronous access
Complete episode 6-4 (mutually exclusive access) with 6-5 (synchronous access)
4.1 In addition to using the synchronized modification method to achieve mutually exclusive synchronous access, what else can use synchronized to achieve mutually exclusive synchronous access, using code description (please show the relevant code and number)?
4.2 What is the difference between a synchronous code block and a synchronization method?
4.3 What is the principle of implementing mutually exclusive access? Use the object lock concept and describe it in conjunction with the corresponding code block. How does the state of the thread change when the program executes the synchronized synchronous code block or synchronous method?
4.4 What keywords are used in Java Multi-threading to implement communication between threads, so that threads work together?
- Inter-Threading collaboration: Producer Consumer issues
5.1 Run the Myproducerconsumertest.java. The result of the normal operation should be 0 goods left in the warehouse. Run multiple times, observe the results, and answer: Is the result normal? What's not normal? Why?
5.2 Use synchronized, wait, notify solve the problem (key code, need to appear number)
5.3 Select: Use lock with the condition object to resolve the problem.
- Object-oriented design job-Library management system
6.1 The system's functional modules table, which reflects the owner of each module.
6.2 Running the video
6.3 Explain the module you are responsible for, and paste the key code of your own module (the number and name of the school).
- Optional: Use other methods to solve the problem of producer consumers of topic 5.
7.1 Using Blockingqueue to solve the key code of producer consumer problem
7.2 explains why you do not need to display the use of wait, notify to resolve synchronization issues. What are the advantages of wait and notify to solve this problem?
7.3 Use condition to solve the problem of producers and consumers.
Choose: Write a piece of code that proves you will use Forkjoinpool.
Optional: Unit Test JUINT4
Topic 6: Unit tests using JUNIT4.
Use JUNIT4 to compare the sort time of two sorting algorithms and.
3. Code Cloud and PTA
Topic Set: Multithreading
3.1. Code Cloud codes Submission record
In the Code cloud Project, select statistics-commits history-set time period, and then search for and
Several elements must appear: Submit Date-user name (name and school number)-no instructions
3.2 "Multi-threaded" PTA Submission List
Two graphs are required (1. Ranking chart. 2.PTA Submission list diagram)
3.3 Count the amount of code completed this week
The weekly code statistics need to be fused into a single table.
- Optional: Extracurricular reading
4.1 Java Concurrent Animated
Advanced knowledge Notes for 4.2 threads
4.3 Questions and exercises:concurrency, learn to summarize.
4.4 Java Multi-thread executor, Executorservice, executors, callable, future and Futuretask
4.5 thread pool, this one might be enough.
4.6 Java 8 Concurrency tutorial:threads and executors
Java Jobs-Multithreading