Link to home
Start Free TrialLog in
Avatar of dlb_sun
dlb_sunFlag for United States of America

asked on

Banker's Algorithm

This is an academic question (i.e. student question).  Since the original person who was helping ran into some computer problems, he/she asked me to delete the first one and repost.  Therefore, I am.  I am a student at Uinversity of New Mexico in an OS class working on my second masters.  I've been around for a while, and am not trying to cheat the system :-)

My study partner and I have worked on this and have run into a deadend (sort of).  When I compile the code it runs correctly for the first run.  The next runs have a segmentation fault.  When I recompile . . . it runs good for the first run, then has a segmentation fault for the next runs . . . on and on.  Therefore, I know we are just about there, but...we are apparently missing something (probably fairly simple).  That's the problem with we students . . . little problems can really be big, and big problems can really be little.  Therefore, I'm asking for assistance.

Apparently we have the basic concept laid out correctly, or it wouldn't run correctly the first time.  I believe the problem lies somwhere around lines 40 thru 45.  I think that the way we have the PThread being created may be causing a problem.  However, I'm not sure.  Thus, my question.  

I've attached the code.  Please take a look and let me know your thoughts.  I don't want anyone to do it for me, I just want some advice.  


Thanks much,
Darrell
rrb-bankers.c
ASKER CERTIFIED SOLUTION
Avatar of mccarl
mccarl
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dlb_sun

ASKER

Thanks for your advice.  Although it didn't specifically rectify all our issues, it did help in that direction.  I apologize for being so long in getting back to this.