Professional Documents
Culture Documents
Fall 2023 - CS604P - 1
Fall 2023 - CS604P - 1
Assignment # 01 Deadline
23/11/2023
Fall 2023
Please carefully read the following instructions before attempting the assignment.
You should consult the recommended books to clarify your concepts as handouts are not sufficient.
Images and tables can be inserted using the following highlighted option in the interface .
OBJECTIVE
The objective of this assignment is to provide hands-on experience in the:
Linux Thread
Thread creation APIs
Compiling and Running C Programs in a Linux environment.
NOTE
No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding
or internet malfunctioning etc.). Hence refrain from uploading assignments in the last hour of the deadline. It is
recommended to upload the solution at least two days before its closing date.
If you people find any mistake or confusion in the assignment (Question statement), please consult with your
instructor before the deadline. After the deadline, no queries will be entertained in this regard.
You are required to create the C program, that creates the two user-level threads named T1 and T2 by using
the pthread_create() API function, the functionality of the two threads are as follows.
The first thread T1, should print the table 5, and from the main program you should pass the
parameter value of 5 as an integer to the T1 thread to print the required table of 5.
In the second thread T2, it should print your name on the screen. Secondly, your name should be
passed to the T2 from the main() function as a character array.
In the main function call the pthread_join() function to wait for the main function for both threads.
Note: in case you have installed the Virtual Box you can take the screenshot as follows. Go to the view
menu and click on Take Screenshot as follows.
See the following link for the installation of Virtual Box and Ubuntu (Linux) on your system.
https://vulms.vu.edu.pk/CourseResources/OpenFile.aspx?
File=tutorial_for_installing_virtualbox_and_ubuntu.mp4
See the following link installing gcc and compiling and running your first program in Linux.
https://vulms.vu.edu.pk/CourseResources/OpenFile.aspx?File=How%20to%20install%20gcc%20on
%20Ubuntu%20and%20compile%20a%20C%20program.mp4
The End