-
各个线程任务分配是这样实现的。在开始下载时,文件平均分成若干块进行下载。如第一个线程一开始的任务是从文件的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
-
直接用socket实现HTTP协议(下载专用)
作者:北方工业大学2000级计算机4班 querw
从HTTP服务器上下载一个文件有很多方法,"热心"...
直接用socket实现HTTP协议(下载专用)
作者:北方工业大学2000级计算机4班 querw
从HTTP服务器上下载一个文件有很多方法,"热心"的微软提供了WinInet类,用起来也很方便.当然,我们也可以自己实现这些功能,通过格式化请求头很容易就能实现断点续传和检查更新等等功能.- Straight takes over the use of socket to realize the HTTP
agreement (special-purpose downloading) the author: North industrial
university 2,000 levels of computers 4 class of querw downloaded a
document from the HTTP server to have very many methods, the
"warm-hearted" Microsoft has provided the WinInet kind, used very to
be also convenient Certainly, we also may own realize these
functions, is very easy through formatted request to be able to
realize the break point to continue passes on and inspects renewal and
so on function
- 2022-11-12 19:15:03下载
- 积分:1
-
server connectivity source
服务器winsock连接源码-server connectivity source
- 2022-07-26 10:04:36下载
- 积分:1
-
VisualC++实现网络
VisualC++实现的网络-网页爬虫程序源代码-VisualC++ Realize the network- the page source code reptiles
- 2023-04-07 05:35:04下载
- 积分:1
-
article management system using asp, mainly used for information website article...
文章管理系统采用asp,主要用来建立文章信息网站,可以方便随时更新网站文章,主要特点是文章中插图可以方便采用其他网站图片地址,加快访问速度。网上下载的简单源码,加入自己大量修改。-article management system using asp, mainly used for information website articles can be easily updated Web site article, the main characteristic is illustrated article can easily use other photo site addresses, accelerate speed access. Downloading a simple source, add his own extensive modification.
- 2022-01-26 08:06:27下载
- 积分:1
-
procedures classic PHP shopping network Cart achieve php
PHP购物程序
经典的网络购物车php实现-procedures classic PHP shopping network Cart achieve php
- 2022-01-30 18:15:30下载
- 积分:1
-
基于TCP/IP协议的温度数据采集与控制界面,很好用的。
基于TCP/IP协议的温度数据采集与控制界面,很好用的。-the collection and control of tempereture data which are based on tcp
- 2022-07-18 11:16:37下载
- 积分:1
-
serverudp
serverUDP
-serverUDP
- 2022-04-27 14:53:31下载
- 积分:1
-
邮件发送模块,使用之前需要安装Jmail组件,然后在代码中设置SMTP服务器等信息。...
邮件发送模块,使用之前需要安装Jmail组件,然后在代码中设置SMTP服务器等信息。-E-mail module, prior to use Jmail need to install components, and then in the code set up SMTP server information.
- 2022-04-27 01:00:34下载
- 积分:1
-
icmp开发
icmp开发-icmp development
- 2022-09-16 07:40:02下载
- 积分:1