Results 1 to 3 of 3

Thread: deadlock in producer-consumer problem

  1. #1
    Join Date
    Sep 2011
    Location
    South Africa
    Beans
    161
    Distro
    Xubuntu 12.10 Quantal Quetzal

    deadlock in producer-consumer problem

    Hi

    I'm just wondering, is it possible to get deadlock in a properly done solution of the producer-consumer problem using semaphores?

    I'm supposed to give an example of such and I can't see how that's possible as deadlock arises from circular dependecies (cannot happen in producer-consumer)

    Regards,

    A
    Last edited by 3v3rgr33n; March 18th, 2013 at 07:51 PM.

  2. #2
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,084
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: deadlock in producer-consumer problem

    This sounds like homework. Doesn't the Wikipedia page help?

  3. #3
    Join Date
    Sep 2011
    Location
    South Africa
    Beans
    161
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: deadlock in producer-consumer problem

    lol It was homework. I read that page numerous times. I then realized that I'm supposed to give a sloppy solution to the producer-consumer problem. I made one process try to acquire the lock twice and I did get deadlock. (note that the lock is not re-entrant).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •