2018 Spring Object Oriented Eighth Homework

Summary blog assignment

(1) From the aspect of multi-thread coordination and synchronization control, analyze and summarize the design strategy and its changes from the three operations.

fifth assignment

The three elevators are three threads respectively, the input processing is one thread, and the elevator scheduling is one thread.

sixth assignment

Each monitoring task is a thread, and input processing is a thread.

The seventh homework

100 taxis each have 100 threads, the input is processed as one thread, and the scheduler is divided into three parts, each part is a thread.

All three jobs are used Lockwhen operations on shared resources are required lock try catch finally unlock.

(2) Analyze your own program structure based on metrics

fifth assignment

Class Diagram

sixth assignment

Class Diagram

The seventh homework

Class Diagram

(3) Analyze the bug of your own program

fifth assignment

  • One less hit ifleads to misjudgment of piggybacking

  • Used many times System.currentMillis, the method itself is time-consuming, resulting in time errors, and then use it insteadSystem.nanoTime

sixth assignment

  • Typing an output path-changederror intosize-changed

The seventh homework

  • Forgot to judge the coordinates are legal

(4) Analyze your own strategies for discovering other people's program bugs

Fate, amazing

(5) Experience

As long as everyone gives a little love, the world will become a better tomorrow

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325151222&siteId=291194637