The progress bar
In fact, the concept of a progress bar existed long before computers were invented. In 1896, a Polish economist, Karol Adamiecki, invented a diagram called a Harmonogram (Polish for timetable); At the same time, Henry Gantt proposed a similar method and popularized it in the West. Adamiecki’s chart is known as a Gantt chart.
Then computers came along, and the concept of gantt charts was later used in computing. Mainly used for the computer in the processing of tasks, real-time, in the form of pictures to show the speed of processing tasks, degree of completion, the size of the remaining unfinished tasks, and may need to deal with time, generally in rectangular strip display.
The first progress bar in human history in a computer appeared in Mitchell Model’s doctoral thesis in 1979. Model uses a progress bar to show the computer’s progress on a task, which is what we often see today.
A progress bar was introduced in the computer world to tell the user that the computer was working hard in a graphical way. Imagine if there were no progress bar, the user would not be able to tell whether the program was processing or not responding. There’s no way to know what’s going on.
Therefore, the progress bar is more designed to satisfy the user’s psychology and relieve the user’s anxiety.
However, the progress bar displayed on the computer is not real progress, but an estimate. The usual calculation method is:
Operations/Total Operations = Percentage of progress barsCopy the code
For example, when we copy a file, the total size of the file is 100M, the computer can estimate the total time required to copy the file according to the size and time of the copy, and then we can calculate the progress according to the comparison between the used time and the total time.
What do you do 99% of the time?
In “How to Explain P2P to Your Girlfriend?” In fact, the download software is now using P2P technology for file download.
In P2P mode, when we want to download a movie, we do not download it sequentially from a source. Instead, it downloads from multiple P2P nodes in multiple threads, and then integrates the downloaded resources together.
The process is similar to how we build computers. We buy different parts from different stores at the same time and build our own computers.
However, we know that due to the impact of the place of shipment, delivery time, logistics, etc., the arrival time of all parts is definitely not the same. Some will arrive first, some after.
So, if some parts arrive first, we need to continue to wait for the last parts to arrive.
If we need 100 parts to assemble a computer and 99 of them have arrived, but the last one has not been shipped due to inventory, then the overall computer assembly should be at 99% progress and will remain at 99% for a long time.
Therefore, due to the P2P download mode, files are downloaded from multiple nodes. Due to the inconsistent download speed from each node, resources of some nodes will be slower than others, and the progress will be stuck at 99%.
In addition, in addition to the above reasons, there is another case.
That is, we have received all the computer accessories. When we started assembling, we found that there was a problem with one of the accessories, which was damaged in the transportation process. At this time, we need to contact the merchant for replacement. This process also leaves the overall computer assembly stuck at 99%.
Therefore, because resources are downloaded in chunks, they need to be combined and calibrated at the last stage of the download, and when a block is found to be faulty during the calibration, they need to be downloaded again. The process is stuck at 99%.