-
各个线程任务分配是这样实现的。在开始下载时,文件平均分成若干块进行下载。如第一个线程一开始的任务是从文件的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
-
ts170
可以得到很精确的幅值、频率、相位估计,基于K均值的PSO聚类算法,光纤陀螺输出误差的allan方差分析。( You can get a very accurate amplitude, frequency, phase estimation, K-means clustering algorithm based on the PSO, allan FOG output error variance analysis.)
- 2017-06-01 16:48:51下载
- 积分:1
-
jsoncpp
vulfhf;hfiuvbibu44848919189
- 2020-06-23 17:20:02下载
- 积分:1
-
ALO
本程序用VC实现ADO编程的实例,希望对学习数据库的新手有所帮助,,(This procedure using VC realize ADO programming examples, hope to help novice learning database,,)
- 2017-06-26 08:19:34下载
- 积分:1
-
WIN32 API写的第一个函数,只是传一个字符串就结束了,但是体现了socket的连接建立过程...
WIN32 API写的第一个函数,只是传一个字符串就结束了,但是体现了socket的连接建立过程-WIN32 API to write a function of just one-on the end of a string, but the embodiment of the socket connection establishment process
- 2022-08-22 16:15:41下载
- 积分:1
-
under the Windows network server program development, no doubt, Winsock complete...
在WINDOWS下进行网络服务端程序开发,毫无疑问,Winsock 完成端口模型是最高效的。Winsock的完成端口模型借助Widnows的重叠IO和完成端口来实现,完成端口模型懂了之后是比较简单的,但是要想掌握Winsock完成端口模型,需要对WINDOWS下的线程、线程同步,Winsock API以及WINDOWS IO机制有一定的了解。如果不了解,推荐几本书:《Inside Windows 2000,《WINDOWS核心编程》,《WIN32多线程程序设计》、《WINDOWS网络编程技术》。在去年,我在C语言下用完成端口模型写了一个WEBSERVER,前些天,我决定用C++重写这个WEBSERVER,给这个WEBSERVER增加了一些功能,并改进完成端口操作方法,比如采用AcceptEx来代替accept和使用LOOKASIDE LIST来管理内存,使得WEBSERVER的性能有了比较大的提高。 -under the Windows network server program development, no doubt, Winsock completed port model is the most efficient. Winsock port model with complete preview of overlap and complete port IO to achieve complete port after the model to understand is a relatively simple, but want to know the complete Winsock port model, the need for the Windows threads, thread synchronization, Winsock API and Windows IO mechanism of a certain understanding. If we do not understand, recommended several books : "Inside Windows 2000," Windows core programming "," WIN32 multithreaded program
- 2023-07-22 22:20:02下载
- 积分:1
-
graphene
石墨烯的结构编程图,这是费了工作人员很长时间才完成的。(The figures of graphene)
- 2013-09-23 09:09:03下载
- 积分:1
-
用rawsocket构造tcp数据包的程序
用rawsocket构造tcp数据包的程序-Rawsocket constructed using tcp packet procedure
- 2022-07-24 11:02:32下载
- 积分:1
-
HA-reshacker34079-LDR
一个很好用的java反编译器,用过很多次,分享一下 java(Decompile java)
- 2009-06-22 13:11:42下载
- 积分:1
-
pop3
说明: 基于c#,利用pop3协议实现 邮件接受功能,初学者必备,简单易懂。(Based on c#, using pop3 protocol implementation to accept e-mail functions, essential for beginners, easy to understand.)
- 2010-03-23 15:23:22下载
- 积分:1