Guest Safepoint API for Virtual Machine Thread Synchronization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional virtual machine (VM) safepoints are initiated by privileged VM instructions, limiting access to VM services for guest language code and requiring additional mechanisms to ensure data consistency during operations like garbage collection, which can lead to inefficiencies and uncontrolled modifications.

Innovation Solution

Implementing a guest safepoint mechanism that allows arbitrary guest language code to run in a consistent state by using VM safepoints, with an API for initiating and managing safepoints, enabling deferred actions that execute after normal VM services are resumed, facilitating efficient intra-thread communication and debugging.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If conventional VM safepoints are used with privileged VM instructions, then data consistency is ensured during VM services, but access to VM services is limited and additional mechanisms are required for guest language code

Engineering Contradiction:
Improveaccess to VM servicesVSAvoidadditional mechanisms
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent segments the safepoint mechanism into two distinct types: conventional VM safepoints (initiated by privileged instructions) and guest safepoints (initiated by guest language code). This segmentation allows guest language code to access VM services through guest safepoints without requiring additional mechanisms for conventional safepoints, thereby improving adaptability while managing complexity through clear separation of concerns

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a safepoint indicator as an intermediary mechanism that mediates between guest language code and VM services. The indicator allows guest code to initiate safepoints and access VM services in a controlled manner, eliminating the need for privileged instructions while maintaining data consistency through the intermediary's coordination

Inventive Principle:
Principle #24Intermediary (Mediator)

2Ease of operation

If guest language code can initiate safepoints directly, then access to VM services is improved, but ensuring data consistency becomes more challenging

Engineering Contradiction:
Improveinitiation of safepointsVSAvoiddata consistency
Core Design Contradiction:
Ease of operationVSReliability

Solution Approach 1:

The patent implements a feedback mechanism through the safepoint indicator that provides visibility into the state of safepoint execution. The indicator allows the VM to track when guest safepoints are initiated and executed, providing feedback that ensures data consistency is maintained even as ease of operation improves through direct guest code initiation

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent employs preliminary action by having guest code check the safepoint indicator before initiating a guest safepoint and before accessing VM services. This preliminary check ensures that safepoints are only initiated when appropriate, maintaining data consistency while allowing direct initiation by guest language code

Inventive Principle:
Principle #10Preliminary action

3Reliability

If synchronization mechanisms are added for guest safepoints, then data consistency is improved, but execution overhead increases

Engineering Contradiction:
Improvedata consistencyVSAvoidexecution efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent implements self-service by having each guest thread independently check the safepoint indicator and execute the guest safepoint action when needed, without requiring centralized coordination or complex synchronization mechanisms. This approach maintains data consistency through individual thread responsibility while minimizing execution overhead by eliminating redundant synchronization

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS9880931B2Safepoints for guest languages on a virtual machine
Publication Date: 2018.01.30 ORACLE INT CORP
  • US9880931B2 patent drawing
  • US9880931B2 patent drawing
  • US9880931B2 patent drawing

AI summary

An application programming interface (API) may include an initiator configured to initiate a guest safepoint via an action represented in a guest language executed on a virtual machine, provide a safepoint action to a group of guest threads, synchronize the guest threads such that each guest thread in the group executes the safepoint action once all guest threads in the group enter the guest safepoint, and synchronize the guest threads such that each guest thread in the group exits the guest safepoint once all guest threads in the group complete execution of the safepoint action. The API may also include a guest configured to determine whether a guest safepoint is initiated, enter the guest safepoint, execute the safepoint action while execution of a guest action is paused, and exit the guest safepoint and resume execution of the guest action once the safepoint action completes execution.