Adaptive Ticket Locking Sleep Duration Calculation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In multiprocessing systems, processes often waste CPU cycles while spinning for spinlocks, as the duration for sleeping when unable to secure a lock is unknown, leading to inefficiencies and potential delays when the lock is released.

Innovation Solution

An adaptive ticket locking mechanism that assigns sequential ticket numbers to processes, allowing them to spin for a predetermined number of cycles, calculate the sleep duration based on ticket processing rates, and sleep only if the estimated time exceeds a threshold, thereby optimizing CPU usage and minimizing overhead when reattempting to acquire the lock.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If processes continuously spin for spinlocks, then they can immediately acquire the lock when available, but CPU cycles are wasted and system efficiency decreases

Engineering Contradiction:
Improvelock acquisition reliabilityVSAvoidCPU cycle waste
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

The patent implements periodic action by having processes alternate between spinning and sleeping in cycles. Instead of continuously spinning, processes spin for a predetermined number of CPU cycles, then sleep for a calculated duration based on ticket processing rates, and repeat this periodic pattern until the lock is acquired. This resolves the contradiction by maintaining lock acquisition capability while eliminating continuous CPU waste.

Inventive Principle:
Principle #19Periodic action

Solution Approach 2:

The patent applies dynamics by making the sleep duration adaptive rather than fixed. The sleep duration is dynamically calculated based on the ticket processing rate observed during spinning cycles and the number of tickets remaining. This allows the system to adapt to varying load conditions, optimizing the balance between immediate lock acquisition and CPU cycle conservation.

Inventive Principle:
Principle #15Dynamics

2Loss of energy

If processes sleep for extended periods when unable to secure a lock, then CPU usage is optimized, but the time to acquire the lock increases

Engineering Contradiction:
ImproveCPU cycle utilizationVSAvoidlock acquisition time
Core Design Contradiction:
Loss of energyVSLoss of time

Solution Approach 1:

The patent implements feedback by continuously monitoring the ticket processing rate during spinning cycles and using this information to adjust the sleep duration. The system observes how many tickets are processed per CPU cycle, calculates the remaining wait time based on tickets ahead in the queue, and adjusts the sleep period accordingly. This feedback mechanism ensures processes sleep long enough to save CPU cycles but not so long as to unnecessarily delay lock acquisition.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent applies parameter changes by dynamically adjusting the sleep duration parameter based on system conditions. Rather than using a fixed sleep time, the system changes the sleep parameter adaptively based on the observed ticket processing rate and queue position, optimizing the trade-off between CPU utilization and lock acquisition time.

Inventive Principle:
Principle #35Parameter changes

3Productivity

If processes calculate and sleep based on estimated lock availability, then CPU efficiency improves, but system complexity increases

Engineering Contradiction:
Improvesystem throughputVSAvoidlocking mechanism complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent applies self-service by having processes autonomously calculate their own sleep duration based on information they can obtain themselves (ticket number, observed processing rate). Each process independently determines when to spin and when to sleep without requiring complex centralized control, reducing system complexity while maintaining productivity benefits.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent implements preliminary action by having processes perform a brief spinning phase to observe the ticket processing rate before calculating and entering the sleep state. This preliminary observation period provides the data needed for accurate sleep duration calculation, enabling efficient CPU utilization without requiring complex pre-computation or external information.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10228985B2Adjustment of a sleep duration for a process based on an expected time for securing a spinlock
Publication Date: 2019.03.12 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10228985B2 patent drawing
  • US10228985B2 patent drawing
  • US10228985B2 patent drawing

AI summary

A computational device maintains a spinlock for exclusive access of a resource by a process of a plurality of processes. In response to determining by the process that a turn for securing the spinlock has not arrived for the process, a sleep duration is determined for the process, prior to making a next attempt to secure the spinlock.