Kernel Reply Port Mechanism for IPC Priority Management

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In modern computer systems, threads often experience blocked execution due to waiting for responses from lower-priority threads, leading to inefficient use of resources and potential starvation of higher-priority threads, especially when managing inter-process communication (IPC) requests.

Innovation Solution

The operating system temporarily adjusts the execution priority of threads involved in IPC requests by using a reply port mechanism, where the kernel elevates the priority of the responding thread upon receiving a request and returns it to its original priority after the response is sent, ensuring that higher-priority threads do not continue to execute at elevated levels indefinitely.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of time

If the kernel elevates the priority of a responding thread to match the requesting thread's priority, then the requesting thread receives timely responses, but the responding thread may execute at elevated priority indefinitely causing resource starvation of other higher-priority threads

Engineering Contradiction:
Improveresponse timeVSAvoidsystem throughput
Core Design Contradiction:
Loss of timeVSProductivity

Solution Approach 1:

The kernel dynamically adjusts the execution priority of the responding thread based on the communication state. The priority is elevated temporarily during the IPC exchange and automatically restored after the response is sent, creating a dynamic priority management system that adapts to real-time needs without permanent resource allocation changes.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The kernel performs preliminary priority adjustment before the responding thread executes the response logic. By setting the elevated priority in advance (when the IPC request is received and matched), the system ensures the responding thread can execute promptly without waiting, while the automatic restoration mechanism prevents indefinite high-priority execution.

Inventive Principle:
Principle #10Preliminary action

2Speed

If the kernel maintains threads at elevated priority levels, then response speed improves, but thread management overhead increases

Engineering Contradiction:
Improveresponse speedVSAvoidthread management complexity
Core Design Contradiction:
SpeedVSDevice complexity

Solution Approach 1:

The system implements self-service through automatic priority restoration. When the responding thread sends its response back to the requesting thread, the kernel automatically restores the original priority level without requiring manual intervention or complex management logic. This reduces the burden on the thread management system while maintaining fast response speeds.

Inventive Principle:
Principle #25Self-service

3Productivity

If lower-priority threads are allowed to execute at higher priority temporarily, then IPC efficiency improves, but resource starvation of other high-priority threads may occur

Engineering Contradiction:
ImproveIPC efficiencyVSAvoidpriority scheduling fairness
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The priority elevation is applied periodically and temporarily only for the duration of the IPC exchange. The kernel elevates the responding thread's priority when the IPC request is processed, and automatically restores it after the response is sent. This periodic, temporary priority adjustment improves IPC efficiency while preventing long-term resource starvation of other high-priority threads.

Inventive Principle:
Principle #19Periodic action

Data Source

PatentUS10671430B2Execution priority management for inter-process communication
Publication Date: 2020.06.02 APPLE INC
  • US10671430B2 patent drawing
  • US10671430B2 patent drawing
  • US10671430B2 patent drawing

AI summary

Techniques are disclosed relating to inter-process communication. In some embodiments, a kernel receives a notification of a communication to be sent from a first thread of a first application to a second thread of a second application. The kernel provides a reply port to the first thread for receiving a reply to the communication from the second thread. The kernel facilitates sending the communication from the first thread to the second thread. The kernel increases an execution priority of the second thread in response to the kernel determining that the reply port and a destination port associated with the second thread are identified in the communication. In some embodiments, the kernel creates the reply port in response to receiving the notification and, in response to detecting the reply has been communicated to the reply port, decreases the execution priority of the second thread and removes the reply port.