Activity Mask Scheduling for Thread Preemption and Deadlock Prevention

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional operating systems lack flexibility in scheduling independently-schedulable code sequences, often relying on static priority or round-robin approaches, which can lead to inefficiencies and potential deadlocks due to the lack of dynamic activity masking.

Innovation Solution

An operating system that assigns each independently-schedulable code sequence to an activity, allowing activities to mask each other, enabling a flexible scheduling scheme based on activity masks, where activities can preempt others if not enabled and not masked by enabled activities, and activities can be mutually exclusive.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If traditional static priority or round-robin scheduling is used, then the scheduling algorithm is simple to implement, but the system lacks flexibility and may lead to deadlocks

Engineering Contradiction:
Improvescheduling flexibilityVSAvoidscheduling mechanism complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent implements dynamic scheduling by allowing activity masks to be modified at runtime, enabling the scheduling policy to adapt to changing system conditions. The activity mask for each thread can be dynamically adjusted based on current activity, allowing the system to flexibly respond to runtime events while maintaining a relatively simple underlying scheduling mechanism.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent segments the scheduling decision-making process into two independent components: activity masks (which define scheduling constraints) and the scheduling algorithm itself. This separation allows the mask configuration to provide flexibility without complicating the core scheduling logic, as the scheduler simply needs to check mask bits rather than implement complex policy decisions.

Inventive Principle:
Principle #1Segmentation

2Reliability

If activity masks are used to prevent deadlocks, then system reliability improves, but the scheduling mechanism becomes more complex

Engineering Contradiction:
Improvedeadlock preventionVSAvoidscheduling mechanism complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent applies preliminary anti-action by configuring activity masks in advance to prevent potential deadlocks before they occur. Each thread's activity mask is pre-configured to indicate which activities it is willing to wait for, thereby preventing circular wait conditions that lead to deadlocks. This proactive approach enhances reliability without requiring complex runtime analysis.

Inventive Principle:
Principle #9Preliminary anti-action

Solution Approach 2:

The activity mask serves as an intermediary between thread scheduling and deadlock prevention. Rather than implementing complex deadlock detection and resolution logic, the system uses the simple bit-mask mechanism to mediate scheduling decisions, allowing threads to safely wait for specific activities while preventing deadlock scenarios.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Stability of the object's composition

If mutual exclusion between activities is enforced, then system consistency is improved, but scheduling flexibility is reduced

Engineering Contradiction:
Improvesystem consistencyVSAvoidscheduling flexibility
Core Design Contradiction:
Stability of the object's compositionVSAdaptability or versatility

Solution Approach 1:

The patent implements local quality by allowing different activity masks for different threads, enabling fine-grained control over which activities can proceed concurrently. Rather than enforcing uniform mutual exclusion across all activities, each thread can have customized mask settings that reflect its specific synchronization requirements, maintaining consistency where needed while preserving flexibility elsewhere.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS10929178B1Scheduling threads based on mask assignments for activities
Publication Date: 2021.02.23 APPLE INC
  • US10929178B1 patent drawing
  • US10929178B1 patent drawing
  • US10929178B1 patent drawing

AI summary

In an embodiment, an operating system for a computer system assigns each independently-schedulable code sequence to an activity. An activity may thus be associated with a group of related code sequences, such as threads that communicate with each other (whether or not they are part of the same program). When a code sequence is ready to be scheduled and it is not part of the current activity, it may preempt the current activity if the activity for the code sequence is not enabled and is not masked by the enabled activities. Each activity may define which other activities it masks. A flexible scheduling scheme may be devised based on the mask assignments for each activity.