Debug small C Program

Avg Bid (USD)
Project Budget (USD)
$30 - $250

Project Description:
1. First compile and execute the distributed program. Note that it deadlocks.
In order to make running it less frustrating, I made it terminate with the
message ``No runnable threads."

2. Modify the program by changing the order of calls to use two-phase locking
and produce a version of the program with modified threads, which doesn't
deadlock. Note that it never terminates, because each thread sits in a rather
pointless infinite loop.

3. Now go back and solve the deadlock problem by modifying the resource management
package, instead of the thread code: Check for deadlock when a thread waits for
a semaphore, and if granting it would cause deadlock, make the thread wait until
things are safe. (In order to check, you'll need to define some new data structures,
and perhaps insert some additional code into each thread to manage them.)

Additional Project Description:
05/19/2013 at 22:56 IST
Please read the description.

Target platform is Linux (pref. CentOS, Ubuntu, SuSE)

Must be completed today 5/19

Changes must be documented with rationale.

Code must be modified/fixed not rewrittten

C "Experts" in concurrent programming need only apply. If you think it's going to take you more than a few hours to finish this (estimated 3-5 hrs) then you're probably not an expert concurrent programming in C.

The code can be found in the attached sync.c


05/19/2013 at 23:25 IST
Do not use Deadlock.c aside from the fact that it has numerous errors, it also includes dce/pthread.h. which does not exist on most systems. Please use sync.c. The first thing you'll notice is when you compile and run it is that it deadlocks. That is part of the problem that is being solved here.

Also, for those of you who haven't figured this out, you'll probably have to use the -pthread flag when compiling with gcc.

Skills required:
C Programming, Linux, UNIX
Additional Files: Deadlock.c sync.c
About the employer:
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.

$ 147
in 3 days
$ 45
in 3 days
Hire xuhaijiao
$ 34
in 3 days
$ 30
in 3 days
$ 55
in 3 days
$ 188
in 5 days
$ 94
in 2 days
$ 172
in 9 days
Hire meraman1191
$ 66
in 1 days
Hire a0717
$ 155
in 3 days