-
各个线程任务分配是这样实现的。在开始下载时,文件平均分成若干块进行下载。如第一个线程一开始的任务是从文件的0位置开始下载一直到72908位置处。线程1每次下载...
各个线程任务分配是这样实现的。在开始下载时,文件平均分成若干块进行下载。如第一个线程一开始的任务是从文件的0位置开始下载一直到72908位置处。线程1每次下载一块数据后就要调整任务,如第一次下载了20800字节的数据,那么线程1的任务将改为:20800-72908。如此下去,直到任务为72908-72908时表示线程1完成了当前的下载任务。此时,线程1就分析各个线程的任务,找出任务最为繁忙的一个线程:如线程3:14816-218724。那么线程1就自动去调整任务,拿50%的任务来再次下载。周而复始直到各个线程都完成任务。不过这里有一点需要注意:为了避免重复下载部分数据,在调整任务的时候,起始的文件便移量必须加上接受缓冲器的字节数,因为如前面所举的列子来看。线程1和线程3在平衡负载的时候,线程正在下载数据,如果所剩的数据比接受缓冲器的大小还小,线程1和线程3的部分下载数据将会重复。
在调整任务和分析任务的时候,会发现一个问题。就是读取文件数据太过频繁。于是我用了一个数据结构。在下载文件的过程中始终打开配置文件,这样速度提高了很多。在文件下载完毕后关闭文件。-various threads assignment is achieved. At the beginning of the download, the paper divided into a number of pieces of the download. As a thread of a task is to start from the position paper of 0 to start the download has 72,908 locations Department. Thread a download each one will have to adjust the data tasks, such as the first downloaded 20,800 gigabytes of data, then threaded a task will be re :20800- 72908. This situation continues until the mandate of 72908-72908 said threaded a completion of the cu
- 2022-03-20 03:50:55下载
- 积分:1
-
25811267WAV-LSB-Watermark
说明: 基于lsb的音频水印程序,能正确运行,希望有用(Audio watermarking program based on LSB)
- 2021-04-26 08:58:45下载
- 积分:1
-
Scara机器人 TCP UDP通信
说明: 支持功能为以太网 modbus TCP/UDP通信 , 10进制转16进制 ,16进制转10进制 ,简单MFC界面,软件版本为VS2010源码,字符解析,报文解析。封装Modbus TCP通信类可以直接用(The supporting functions are Ethernet Modbus TCP / UDP communication, hexadecimal to hexadecimal, hexadecimal to hexadecimal, simple MFC interface, software version is VS2010 source code, character parsing, message parsing. Package Modbus TCP communication class can be used directly)
- 2019-12-27 21:57:08下载
- 积分:1
-
Windows程序设计(第五版)北大版
windows api编程经典,可以深入了解windows运行机制(Windows API programming classic, you can get a deep understanding of the Windows running mechanism)
- 2017-12-31 09:12:03下载
- 积分:1
-
GB28181-2011T
GB28181-2011T 安全防范视频监控联网系统信息传输、交换、控制技术要求(GB SAFE VIDEO)
- 2013-08-24 13:34:24下载
- 积分:1
-
2D2P
二维颗粒扰流模拟,求解单管扰流下,气固两相流动。(Two-dimensional particle simulation spoiler, spoiler solving single-tube, the gas-solid flow.)
- 2011-06-22 11:51:19下载
- 积分:1
-
web
测试程序,可以很好的利用这个程序解决你所遇到的问题(Test procedure can be a very good use of this procedure to solve the problems encountered by you)
- 2008-07-24 11:26:37下载
- 积分:1
-
MED算法(用于故障诊断)
针对较大噪声工况下机械故障诊断中的齿轮故障特征提取。(Minimum Entropy Deconvolution)
- 2018-07-19 14:18:02下载
- 积分:1
-
WpfApplication1
简单的mvvm wpf做的点菜系统,是学习MVVM 的最好的列子(A simple MVVM WPF order)
- 2017-06-09 16:43:39下载
- 积分:1
-
WPE问道封包处理助手
快速处理抓到的WPE封包()
- 2017-12-15 21:56:20下载
- 积分:1