CPU/GPU Mutex Synchronization via Shadow Threads

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In multithreaded applications, the existing mechanisms for synchronizing access to shared data between a central processing unit (CPU) and a graphics processing unit (GPU) are inefficient due to reliance on mutex locks, which can lead to power and performance issues, especially when threads on different cores need to access shared resources.

Innovation Solution

A processing apparatus is introduced that creates an auxiliary shadow thread on the CPU to manage mutex locking and unlocking for threads on the GPU, allowing the operating system to handle thread synchronization, enabling efficient communication and synchronization between CPU and GPU threads through system calls and shadow threads.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If mutex locking is implemented through spinning on lock, then thread synchronization between CPU and GPU is achieved, but power consumption increases and performance deteriorates

Engineering Contradiction:
Improvethread synchronizationVSAvoidpower consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The patent introduces an intermediary mechanism where the CPU writes mutex state to GPU-visible memory locations and the GPU polls these locations to determine mutex availability. This intermediary approach replaces direct spinning locks with a mediator-based synchronization protocol, reducing unnecessary busy-waiting and improving power efficiency while maintaining synchronization reliability.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent implements dynamic synchronization behavior where threads can choose between polling and sleeping modes based on mutex availability. When a mutex is available, threads proceed immediately; when unavailable, threads can sleep and be notified when the mutex becomes available. This dynamic approach adapts to system conditions and avoids continuous power-consuming polling.

Inventive Principle:
Principle #15Dynamics

2Reliability

If mutex locking is implemented through spinning on lock, then thread synchronization between CPU and GPU is achieved, but processing speed decreases

Engineering Contradiction:
Improvethread synchronizationVSAvoidprocessing speed
Core Design Contradiction:
ReliabilityVSSpeed

Solution Approach 1:

The patent implements preliminary action by having the CPU write the mutex state to GPU-visible memory locations before the GPU needs to access it. This advance preparation allows the GPU to quickly check mutex availability without prolonged waiting, improving processing speed while maintaining synchronization reliability.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent implements a feedback mechanism where the GPU polls CPU-written mutex state and receives implicit feedback about mutex availability. When the mutex state changes, the system can notify waiting GPU threads, providing timely feedback that accelerates synchronization and improves overall processing speed.

Inventive Principle:
Principle #23Feedback

3Reliability

If system calls are used for mutex synchronization, then thread coordination between CPU and GPU is improved, but system complexity increases

Engineering Contradiction:
Improvethread coordinationVSAvoidsystem complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent implements a universal synchronization mechanism that handles both CPU-CPU and CPU-GPU mutex coordination through the same shadow thread infrastructure. The shadow thread system provides multi-functional capability, managing mutex locks for different processor types uniformly, which improves coordination reliability while managing system complexity through consolidation rather than multiplication of mechanisms.

Inventive Principle:
Principle #6Universality (Multi-functionality)

4Productivity

If shadow threads are introduced for mutex management, then mutex operation efficiency is improved, but implementation complexity increases

Engineering Contradiction:
Improvemutex operation efficiencyVSAvoidimplementation complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent implements self-service through shadow threads that autonomously manage mutex locking and unlocking operations. The shadow threads independently monitor mutex state, write to GPU-visible memory, and notify waiting threads without requiring direct CPU-GPU coordination for each mutex operation. This self-service approach improves mutex operation efficiency while containing implementation complexity by delegating management to specialized autonomous threads.

Inventive Principle:
Principle #25Self-service

Data Source

PatentEP3211525B1Cpu/gpu synchronization mechanism
Publication Date: 2020.04.29 INTEL CORP
  • EP3211525B1 patent drawingFigure 1
  • EP3211525B1 patent drawingFigure 2
  • EP3211525B1 patent drawingFigure 3

AI summary

A thread on one processor may be used to enable another processor to lock or release a mutex. For example, a central processing unit thread may be used by a graphics processing unit to secure a mutex for a shared memory.