×

Efficient task scheduling using a locking mechanism

  • US 10,579,413 B2
  • Filed: 08/14/2013
  • Issued: 03/03/2020
  • Est. Priority Date: 08/14/2013
  • Status: Active Grant
First Claim
Patent Images

1. A method for efficient task scheduling using a locking mechanism by a processor device in a computing environment, the method comprising:

  • allowing a new task to spin on the locking mechanism comprising a lock try-or-spin lock if a number of tasks spinning on the locking mechanism is less than a predetermined threshold for parallel operations requiring locks between multiple threads;

    if the number of the tasks spinning on the locking mechanism is one of equal to and more than the predetermined threshold, performing the step of;

    failing the new task in lieu of the new task entering a sleep state by returning a fail notification,yielding the processor device to execute additional tasks, andexiting the new task and thereby avoid having the new task spin in a a first queue having a first queue length of a separate ticket based lock, wherein the number of tasks spinning on the locking mechanism is determined by examining a last ticket number provided when compared to a current serving ticket number in the first queue of the ticket based lock and wherein the first queue is called to determine whether the number of tasks spinning on the locking mechanism is less than the predetermined threshold prior to dispatching the new task and allowing the new task to attempt to acquire the lock try-or-spin lock, and the ticket based lock.

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