-
各个线程任务分配是这样实现的。在开始下载时,文件平均分成若干块进行下载。如第一个线程一开始的任务是从文件的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
-
a touch screen to write browser procedures, with a soft keyboard (VC, 180KB)
一个为触摸屏写的浏览器程序,带一个软键盘 (VC, 180KB)-a touch screen to write browser procedures, with a soft keyboard (VC, 180KB)
- 2023-02-15 13:40:04下载
- 积分:1
-
sockte编程指南,内容清晰适合初,中级者阅读,为以且学习加快速度...
sockte编程指南,内容清晰适合初,中级者阅读,为以且学习加快速度-sockte Programming Guide, which clearly fit the early, intermediate reading, and studying for speed
- 2022-04-28 12:40:30下载
- 积分:1
-
网上聊天室,一个简单的程序例子,可以帮助初学者学习网…
网络聊天室,一个简单的例子程序,可以帮助初学者学习网络编程.-Internet chat rooms, a simple procedure example, can help beginners learning network programming.
- 2023-06-08 23:15:13下载
- 积分:1
-
发MathFP源码,用于做定点数处理
发MathFP源码,用于做定点数处理-Fat MathFP source code for doing fixed-point processing. . . .
- 2023-07-27 23:45:08下载
- 积分:1
-
这是一个VNC源代码,号称世界上监控速度最快的监控系统.
这是一个VNC源代码,号称世界上监控速度最快的监控系统.-This is a VNC source code, which claims to monitor the world
- 2023-02-28 07:15:04下载
- 积分:1
-
一个简单的vc下tcp客户端程序 向服务器提出TCP连接的请求,当连接建立后,从服务器的端口接收数据并进行显示,然后断开与服务器的连接...
一个简单的vc下tcp客户端程序 向服务器提出TCP连接的请求,当连接建立后,从服务器的端口接收数据并进行显示,然后断开与服务器的连接-Vc under a simple tcp client TCP connection to the server made the request, when the connection is established, from the server port to receive data and display, and then disconnect the connection with the server
- 2022-08-12 15:54:17下载
- 积分:1
-
通过建立通信套接字,必须理解如何使用…
通过winsock建立通信,必须了解如何利用如何指定的协议为工作站定址,-Winsock through the establishment of communications, must understand how to use the agreement specify how the workstation is located,
- 2022-12-26 02:15:03下载
- 积分:1
-
使用Windows Socket API编写的通用函数,包含异步socket的使用
使用Windows Socket API编写的通用函数,包含异步socket的使用-General function writed by Windows Socket API, containing the use of non-synchronized socket
- 2022-08-21 08:54:25下载
- 积分:1
-
LDAP操作使用,jbuilder开发。
LDAP操作使用,jbuilder开发。-LDAP operate, JBuilder development.
- 2022-03-21 21:09:40下载
- 积分:1