0% found this document useful (0 votes)
14 views3 pages

Spring 2024 - CS609 - 2

Spring 2024_CS609_2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

Spring 2024 - CS609 - 2

Spring 2024_CS609_2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Spring 2024 Total Marks: 20

CS609: System Programming Due Date: 24


Assignment No. 02 June 2024

Instructions:
Please read the following instructions carefully before submitting an assignment. It should be
clear that your assignment will not get any credit if:

▪ The submitted assignment does not open or the file is corrupt.

▪ You have not fulfilled all the requirements described in problem statement.

▪ Assignment is copied (partial or full) from any source (websites, forums, students,

etc.). Strict action will be taken in this regard.


Submission Guidelines:

1. You need to upload the following two files in a single .zip or .rar format:
(i) .CPP file (C++ source file, containing code)
(ii) .exe file (executable file, created after compilation)
2. Any other file type (.docx, .txt, .pdf, .jpeg, .gif) shall not be acceptable and you would get
zero marks for this.

Key Learning Objectives:

● Understand and use the Windows API for file operations.

● Implement multi-threading in a Windows environment.

● Handle file I/O operations safely and efficiently in a concurrent setting.

● Debug and handle errors in multi-threaded applications.

Topics Covered:
70 to 120
Problem Statement:

Write a C++ program that copies a file from one location to another using multiple threads to read and
write the file in chunks. This will involve using the Windows API for process and thread management,
as well as file I/O operations.
Assignment Tasks:
1. The program should take three command-line arguments:
 Source file path
 Destination file path
 Number of threads to use
2. Use the Windows API to open the source and destination files.
3. Divide the file into chunks and assign each chunk to a separate thread.
4. Each thread will read its assigned chunk from the source file and write it to the destination file.
5. Ensure correct synchronization and handle any potential errors during file operations.
6. Measure and display the time taken to copy the file using the specified number of threads.
Output Requirements:
1. After taking the inputs, program should display the following information as the output:
a. Files Size
b. Thread number
c. Number of bytes copied by each thread
d. Offset from where data was copied
e. Total time taken to copy the file.
Sample Output:
Note:
 You should print your student ID at the top of output screen. You will be awarded zero marks if
the mentioned student ID is not yours.
 In case of any assignment related query, please do not post any question on MDB. Contact at
[email protected] for asking assignment related questions.

---BEST OF LUCK---

You might also like