Determining when to release a lock from a first task holding the lock to grant to a second task waiting for the lock

US12175304B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-12175304-B2
Application numberUS-202117475866-A
CountryUS
Kind codeB2
Filing dateSep 15, 2021
Priority dateJul 6, 2016
Publication dateDec 24, 2024
Grant dateDec 24, 2024

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

Provided are a computer program product, system, and method to determine whether a holding of a lock to the resource by a first task satisfies a condition and whether the lock is swappable. The lock is released from the first task and granted to a second task waiting in a queue for the lock in response to determining that the holding of the lock satisfies the condition and that the lock is swappable. The first task is indicated in the queue waiting for the lock in response to granting the lock to the second task.

First claim

Opening claim text (preview).

What is claimed is: 1. A computer program product for managing access to a resource in a computer system, the computer program product comprising a non-transitory computer readable storage medium having computer readable program code embodied therein that when executed performs operations, the operations comprising: granting a lock to a first task, executing in the computer system, providing exclusive access to a first resource; determining whether the first task requires access to a second resource in the computer system before performing an operation with respect to the first resource; providing a swappable flag for the lock indicating whether a holding task may release the lock upon a condition being satisfied; setting the swappable flag for the lock to indicate the lock is swappable in response to the determining that the first task requires access to the second resource; and in response to the swappable flag for the lock indicating the lock as swappable and a condition satisfied with respect to the lock, releasing the lock from the first task and grant the lock to a second task before the first task has obtained access to the second resource. 2. The computer program product of claim 1 , wherein the operations further comprise: receiving, by the first task, access to the second resource; determining whether swapping is enabled in response to the receiving the access to the second resource; and setting the swappable flag to indicating the lock is unswappable in response to the determining that the swapping is enabled. 3. The computer program product of claim 1 , wherein the determining whether the first task requires access to the second resource is performed in response to determining that swapping is enabled for the lock when the lock provides the exclusive access to the first resource. 4. The computer program product of claim 1 , wherein the condition is satisfied in response to the lock to the first resource held for a maximum hold time and the second task for the first resource has higher priority than the first task granted the access. 5. The computer program product of claim 1 , wherein the condition is satisfied in response to the lock to the first resource held for a maximum hold time, the second task has a lower priority than the first task granted access to the first resource, and swapping is allowed to a lower priority waiter. 6. The computer program product of claim 5 , wherein the condition is satisfied if in addition to swapping allowed to the second task, a number of times a swap operation performed for lower priority tasks is less than a maximum number of times a swap operation can be performed with the lock for lower priority tasks. 7. The computer program product of claim 1 , wherein the condition is satisfied in response to the lock to the first resource held for a maximum hold time and a number of times a swap operation has been performed for the lock is a maximum number of times. 8. A system for managing access to a resource, comprising: a processor; and a computer readable storage medium having computer readable program code embodied therein that when executed by the processor performs operations, the operations comprising: granting a lock to a first task, executing in the system, providing exclusive access to a first resource; determining whether the first task requires access to a second resource before performing an operation with respect to the first resource; providing a swappable flag for the lock indicating whether a holding task may release the lock upon a condition being satisfied; setting the swappable flag for the lock to indicate the lock is swappable in response to the determining that the first task requires access to the second resource; and in response to the swappable flag for the lock indicating the lock as swappable and a condition satisfied with respect to the lock, releasing the lock from the first task and grant the lock to a second task before the first task has obtained access to the second resource. 9. The system of claim 8 , wherein the operations further comprise: receiving, by the first task, access to the second resource; determining whether swapping is enabled in response to the receiving the access to the second resource; and setting the swappable flag to indicate the lock is unswappable in response to the determining that the swapping is enabled. 10. The system of claim 8 , wherein the determining whether the first task requires access to the second resource is performed in response to determining that swapping is enabled for the lock when the lock provides the exclusive access to the first resource. 11. The system of claim 8 , wherein the condition is satisfied in response to the lock to the first resource held for a maximum hold time and the second task for the first resource has higher priority than the first task granted the access. 12. The system of claim 8 , wherein the condition is satisfied in response to lock to the first resource held for a maximum hold time, the second task has a lower priority than the first task granted access to the first resource, and swapping is allowed to a lower priority waiter. 13. The system of claim 12 , wherein the condition is satisfied if in addition to swapping allowed to the second task, a number of times a swap operation performed for lower priority tasks is less than a maximum number of times a swap operation can be performed with the lock for lower priority tasks. 14. The system of claim 8 , wherein the condition is satisfied in response to the lock to the first resource held for a maximum hold time and a number of times a swap operation has been performed for the lock is a maximum number of times. 15. A method for managing access to a resource in a computer system, comprising: granting a lock to a first task, executing in the computer system, providing exclusive access to a first resource; determining whether the first task requires access to a second resource in the computer system before performing an operation with respect to the first resource; providing a swappable flag for the lock indicating whether a holding task may release the lock upon a condition being satisfied; setting the swappable flag for the lock to indicate the lock is swappable in response to the determining that the first task requires access to the second resource; and in response to the swappable flag for the lock indicating the lock as swappable and a condition satisfied with respect to the lock, releasing the lock from the first task and grant the lock to a second task before the first task has obtained access to the second resource. 16. The method of claim 15 , further comprising: receiving, by the first task, access to the second resource; determining whether swapping is enabled in response to the receiving the access to the second resource; and setting the swappable flag to indicate the lock is unswappable in response to the determining that the swapping is enabled. 17. The method of claim 15 , wherein the determining whether the first task requires access to the second resource is performed in response to determining that swapping is enabled for the lock when the lock provides the exclusive access to the first resource. 18. The method of claim 15 , wherein the condition is satisfied in response to the lock to the first resource held for a maximum hold time and the second task for the first resource has higher priority than the first task granted the access. 19. The method of claim 15 , wherein the condition is satisfied in res

Assignees

Inventors

Classifications

  • Multiprogramming arrangements · CPC title

  • Program synchronisation; Mutual exclusion, e.g. by means of semaphores · CPC title

  • considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration (scheduling strategies G06F9/4881 and subgroups) · CPC title

  • Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues · CPC title

  • G06F9/526Primary

    Mutual exclusion algorithms · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US12175304B2 cover?
Provided are a computer program product, system, and method to determine whether a holding of a lock to the resource by a first task satisfies a condition and whether the lock is swappable. The lock is released from the first task and granted to a second task waiting in a queue for the lock in response to determining that the holding of the lock satisfies the condition and that the lock is swap…
Who is the assignee on this patent?
IBM
What technology area does this patent fall under?
Primary CPC classification G06F9/526. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Dec 24 2024 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 6 related publications on this page (citations in our corpus or others sharing the same primary CPC).