Web Browser Scripting Worker Threads Parallel Execution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Single-threaded scripting systems in web browsers lead to performance degradation and user experience issues due to blocking of operations during time-consuming tasks, which can cause the browser to appear unresponsive and affect multiple tabs.

Innovation Solution

The system extends the scripting language by creating multiple operating-system threads associated with message queues, allowing worker script-engines to execute scripts in parallel, enabling the root script to initialize and manage these threads, and facilitating communication between them.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Device complexity

If a single-threaded scripting system is used, then the event handler execution model is simple, but time-consuming operations block all subsequent operations and make the browser unresponsive

Engineering Contradiction:
Improvescripting system structureVSAvoidoperation execution efficiency
Core Design Contradiction:
Device complexityVSProductivity

Solution Approach 1:

The patent segments the single-threaded event handler execution into multiple independent worker threads. Each worker thread can execute time-consuming operations independently without blocking other operations. The root script remains on the main thread while worker scripts handle computational tasks, I/O operations, or rendering in parallel, thus resolving the blocking issue while maintaining simple event handler semantics within each thread.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transitions from a single-threaded sequential execution model to a multi-threaded parallel execution model by adding a temporal dimension. Instead of executing operations one after another in a single thread, the system creates multiple threads that can execute operations simultaneously, effectively adding a time dimension to the execution model and eliminating blocking.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Productivity

If manual splitting of large operations into smaller units is implemented, then blocking is reduced, but additional bookkeeping causes significant performance degradation

Engineering Contradiction:
Improveoperation execution efficiencyVSAvoidbookkeeping overhead
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent implements self-service by allowing worker scripts to automatically manage their own execution and communication. Each worker script receives tasks through a standardized message queue interface and executes them independently without requiring manual splitting or complex bookkeeping. The system provides automatic task distribution and result collection mechanisms that eliminate the need for manual operation division while maintaining performance.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent creates a universal worker script framework that can handle various types of operations (computational, I/O, rendering) through a common message queue interface. This multi-functional approach eliminates the need for separate bookkeeping mechanisms for different operation types, as all operations use the same standardized communication protocol, thereby reducing overhead while maintaining efficiency.

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

3Device complexity

If time-consuming operations block all subsequent operations, then resource allocation is simplified, but user experience deteriorates due to browser lock-ups

Engineering Contradiction:
Improveresource managementVSAvoiduser responsiveness
Core Design Contradiction:
Device complexityVSEase of operation

Solution Approach 1:

The patent segments resource management by separating the main thread (responsible for user interface and simple operations) from worker threads (responsible for time-consuming operations). This segmentation allows the main thread to remain responsive to user actions while worker threads handle computational tasks independently, thus improving user experience without significantly complicating resource management through standardized thread creation and message queue communication.

Inventive Principle:
Principle #1Segmentation

4Device complexity

If a single-threaded model is used, then the scripting system is simple to implement, but complex web applications cannot execute operations in parallel

Engineering Contradiction:
Improvescripting system structureVSAvoidparallel operation capability
Core Design Contradiction:
Device complexityVSAdaptability or versatility

Solution Approach 1:

The patent segments the scripting system into a main thread for simple operations and multiple worker threads for complex operations. This segmentation maintains the simplicity of the base scripting system while adding parallel capability through optional worker thread creation. The system can execute simple operations sequentially on the main thread and complex operations in parallel on worker threads, thus achieving adaptability without fundamentally complicating the core scripting architecture.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS8065659B1Method and apparatus for executing scripts within a web browser
Publication Date: 2011.11.22 GOOGLE LLC
  • US8065659B1 patent drawing
  • US8065659B1 patent drawing
  • US8065659B1 patent drawing

AI summary

One embodiment of the present invention provides a system that extends a scripting language native to a web browser to facilitate executing scripts within a web browser. During operation, the system receives a first command from a root script to initialize a first worker script within a web browser. In response to the first command, the system: creates a first operating-system thread, wherein the first operating-system thread is associated with a first message queue; starts a first worker script-engine using the first operating-system thread; receives a first message at the first message queue to execute the first worker script; and in response to the first message, executes the first worker script within the first worker script-engine.