C: Simple implementation of mutex

Виконано Опубліковано %project.relative_time Оплачується при отриманні
Виконано Оплачується при отриманні

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

Програмування на С

ID Проекту: #8601026

Про проект

1 заявка Дистанційний проект Остання активність Oct 3, 2015

Доручено:

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 Більше

$25 USD за 1 день
(4 відгуків(-и))
2.5

1 фрілансер у середньому готовий виконати цю роботу за $25

BenjaminFree123

A proposal has not yet been provided

$74 USD за 1 день
(3 відгуків(и))
3.6