1. Create a new module sema with the corresponding file extension (e.g. sema.c with an accompanying sema.h for C, etc.) that implements an algorithm (provided), and add it to a repository. Embed all the data needed to implement your Semaphore in a single struct or class. Don't use any existing POSIX or other Semaphore implementations in your code!
2. Add an initialiser function to your code that sets up a Semaphore and intialises it to a pre-defined (integer) value.
3. Add a destructor function to your code that cleans up properly after the use of a Semaphore (e.g. destroys all mutexes, and condition variables, and releases all memory allocated for a Semaphore).
4. Test the code with a separate program sematest.c that re-implements synchronisation steps (provided) but this time uses semaphores. Use the smallest number of semaphores necessary (and make sure you don't use any other synchronisation constructs outside your semaphore implemetation (with the only exception being pthread_join()))! Your test needs to include a case that clearly shows the difference between using a mutex and a Semaphore!
Further detail provided on acceptance :)
I can solve your problem within 1 day. Quickly and well. I have a lot of experience with C and algorithms. I have recently graduated from the second-best IT university in Europe (University of Warsaw).
$20 AUD in 4 days
5.0 (12 reviews)
4.1
4.1
2 freelancers are bidding on average $21 AUD/hour for this job
Hi, Feel free to discuss the project with me. I have been working as a freelancer and have developed several applications and solved several algorithms.