We are going to simulate the writing of logs. The problem can be specified as follows.
There is a process who reads from a single text file, picks up the next line of text, and puts it in a single buffer. Let there be five buffers and our producer process keeps on trying to fill those five buffers. Access to buffers is controlled by individual semaphores corresponding to each buffer. The process can write into a buffer only if the buffer is empty.
There are a number of other processes (consumers) who keep on looking for a buffer to become full. One of these processes should be able to pick up the text in the buffer and write it into the log file. The process must make sure that the file is not opened by another process for writing. You should use the system call fcntl(2) to ensure file locking.
Look in the zip file.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.
3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).
Using C or C++ to write the program.