Banker’s Algorithm

I just found out that I was the only student in class who actually produced a working implementation of Banker’s Algorithm for the OS class. My weekend was totally shot, but I submitted a finished product that was runnable some 20 minutes before the deadline.

It’s now 4 days past the deadline, and no one else got even close to a working implementation. I’m not claiming my solution is good, or even that it is entirely correct. But it runs, and it appears to be doing what it is supposed to do.

The assignment didn’t seem all that difficult to me. It was allot of work, but I have seen harder things that needed to be done. But then again, maybe my implementation is totally wrong. Perhaps I totally glossed over some of the hard parts everyone seemed to get stuck on… I don’t know.

Dr. Robila said he will not count that problem towards the homework grade, but he will give extra credit to all people who got close to solving it. I guess that’s good, because even if I’m wrong – I might get nice extra credit out of it…

If he checks it and it turns out to be correct though, I’m going to post it somewhere so that future generations can see a working java version :)

This entry was posted in school and teaching. Bookmark the permalink.

9 Responses to Banker’s Algorithm

  1. zewrestler UNITED STATES says:

    make it GPL and release it. i think i’m eventually going to do that with his one shell i had to write the previous year.

    Reply  |  Quote
  2. Luke UNITED STATES says:

    Hehe… I’ll do it, but I want to make sure I implemented it correctly. It would be kindof pointless releasing an implementation that sortoff-works but is funtamentally flawed.

    So I want to see what Robila says about it first :)

    Reply  |  Quote
  3. ENG_HIBA PALESTINIAN TERRITORY, OCCUPIED Internet Explorer Windows says:

    please iam very reqiure code for the banker algorithm in java programing please sent to me if we has in very fast it and iam very hopful for you

    please send it to my mail if you found it

    Reply  |  Quote
  4. Luke UNITED STATES Mozilla Firefox Windows says:

    Dude, it’s already published in the Projects section. Go to that website and scroll down. It’s the 3rd item listed.

    It’s two files. Run the Banker class and it will spawn bunch of Requester objects that will start requesting resources. Here is the readme file.

    Note, this is under GPL which means you CANNOT use it in a commercial product, and you CANNOT submit it as your own work for a class. You must attribute me by name if you use the code in this exact form.

    Reply  |  Quote
  5. splitline UNITED STATES Safari Mac OS says:

    The algorithm is already solved just go to wiki. type in bankers_algorithm.c or *.cpp in google… Cool blog I want to make one for myself. Nice implementation of the algorithm as well


    Reply  |  Quote
  6. augustho Opera Windows says:

    Hello. I need Banker’s algorithm too, but the problem is, that I need to make it in Matlab application. Does anyone may help? – for any ideas. thank you :)

    Reply  |  Quote
  7. Luke Maciak UNITED STATES Mozilla Firefox Windows Terminalist says:

    Well, you can use my Banker code as a template. It’s probably best to re-implement it from scratch since Matlab has a quite different syntax and structure.

    Also, you should never post your email this way. You are just asking to get spammed into oblivion. I can assure you this email will be harvested within a week or so, and you will get 100% more spam in your inbox as a result.

    Reply  |  Quote
  8. corrina_426 CANADA Mozilla Firefox Windows says:

    ah this is gud i have similr problem but differnt
    so i cant solv

    mail me
    pls i need hlp

    Reply  |  Quote
  9. Luke Maciak UNITED STATES Mozilla Firefox Windows Terminalist says:

    @ corrina_426:

    Sigh… Just look at my projects page. There is Java code there with scant or non-existent documentation. If you can figure it out, good for you. If not, I’m afraid I no longer remember anything about that homework. Sorry.

    Also, I should warn you that posting your email address in blog comment threads like this is a very, very bad idea – unless of course you enjoy spam. It will be spidered and added to spam lists within days.

    Then again I see you used a hotmail email so I’m assuming this must be a throwaway account. I mean, no one actually uses hotmail for their regular email, right?

    Reply  |  Quote

Leave a Reply

Your email address will not be published. Required fields are marked *