C代写多进程I/O程序 Explore A Big File调试SQL 程序

& Assignment InformationThis program must be written in ANSI C, compiled with the following options: -Wall -Wextra-std=c99, and display no errors and no warnings. Each program shall consist of one C file. No header files are required. Do not submit executable files (only C source files).The program shall count and display the number of lines (the number of ‘n’ characters) in a large text file. The program shall take one or two command line parameters: the name of the file (required) and the number of subprocesses, N(optional). If the number of subprocesses is not specied, it shall be assumed to be 1. If the second parameter is not a positive integer number, the program shall display an error message and terminate.Each subprocess shall be responsible for counting lines in the part of the file assigned to it by the master process.The master process shall start by getting the file size via stat() or fstat()(you can use either function) and calculating the file fragment size FS as file size divided by N. The first subprocess shall count lines in the first FS bytes of the file, the second subprocess, in the secondFS bytes, etc. The master process shall then:Create 2N pipes(half of them going from the master to the subprocesses and the other half going in the opposite direction),fork() N subprocesses,Wait for all of them to report the number of lines in their fragment, andNotify each reporting subprocess of the successful read from their pipe.You can optimize steps 3 and 4 by using select(), if you want.Once all subprocesses report their results, the master process shall display the total number of lines on the stdout and the total running time on stderr. (Use the f*() functions for reporting, gettimeofday() to measure the total running time.)Each subprocess shall find its portion of the large file with lseek(). It shall then:Allocate enough memoryto read the file fragment,Do the actual read(),Count the number of ‘n’ characters (use a for loop),Deallocate the memory,Report the count to the master process via the pipe (donot convert the integer number to ASCII!),Wait for a notication from the master via the other pipe, andTerminate.Use the following fragment of a major social network to test your program (you must unzip the file before using it). Let me know ASAP if you cannot access the file. The file has 133 MB of data and 9,105,518 lines.Run your program with the values of N=1,2,4,8,16,32. (The number of reported lines must be the same in all 6 cases!) Plot the total running time against N and submit the plot together with the program code.本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp QQ:99515681 或邮箱:[email protected] 微信:codehelp

你可能感兴趣的:(C代写多进程I/O程序 Explore A Big File调试SQL 程序)