×

Efficient mechanism for preventing starvation in counting semaphores

  • US 20060206897A1
  • Filed: 03/08/2005
  • Published: 09/14/2006
  • Est. Priority Date: 03/08/2005
  • Status: Active Grant
First Claim
Patent Images

1. A method for allocating resources to threads in a counting semaphore, said method comprising:

  • maintaining a count of how many of the resources the semaphore currently has available for the threads;

    putting threads to sleep on a wait queue if the semaphore does not have enough of the resources available to satisfy a thread;

    waking a thread up from the wait queue if resources become available for the thread;

    allowing other threads to steal resources from the woken threads before the woken threads can execute; and

    allowing a starving thread to be woken and execute if the starving thread has had more than a predetermined maximum number of resources stolen from it.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×