C: Simple implementation of mutex

Completed Posted Oct 3, 2015 Paid on delivery
Completed Paid on delivery

Create a C/C++ program which meets the below requirements:-

• Must create 3 threads (using Pthread library)

• You will need mutex

• MAIN will open a file ([url removed, login to view]) for wriHng, then call thread #1, thread #2 and thread #3

• MAIN will access a global variable (a single character) that will be used to pass the characters from the threads such that they can be written to file4.out. MAIN will write these characters to the [url removed, login to view] file (the threads this). MAIN will also close [url removed, login to view] when the threads are finished.

• THREAD #1 will open a file ([url removed, login to view]) for reading, read 1 character value from the file ([url removed, login to view]), and put that value in a global variable. Thread #1 will then wait for thread #2 and #3 before moving on to the next

• value (in [url removed, login to view]).

• Similarly, THREAD #2 will open a file ([url removed, login to view]) for reading, read 1 character value, and put that value in a global variable. Thread #2 will then wait for #3 & #1

• Similarly, THREAD #3 will open a file ([url removed, login to view]) for reading, read 1 character value, and put that value in a global variable. Thread #3 will then wait for #1 & #2

• Once all the data is read from three files (file1, file2 and file3 using Thread #1,#2,#3 respecHvely) return the control to main.

• The input files will be of the same size

• Then print the following on [url removed, login to view], one character per line

C Programming

Project ID: #8601026

About the project

1 proposal Remote project Active Oct 3, 2015

Awarded to:

naranimanish

Have been working with Linux Kernel Programming since more than 2 years. Have deep insights of C/C++ programming. Have experience of developing device drivers for USB 3 devices on Xilinx Zynq Embedded Platform I More

$25 USD in 1 day
(4 Reviews)
2.5

1 freelancer is bidding on average $25 for this job

BenjaminFree123

A proposal has not yet been provided

$74 USD in 1 day
(3 Reviews)
3.6