# US 2008/0313647 A1 · Thread virtualization techniques

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2008/0313647 A1
- Document ID: US20080313647A1
- Status: Published application
- Kind: A1
- Application number: 11/820,065
- Filed: 2007-06-18
- Published: 2008-12-18
- Earliest claimed: 2007-06-18
- Assignees: Microsoft Corporation
- Inventors: Matthew D. Klein; Paul England
- Web page: https://patentgrep.com/patent/US20080313647A1

## CPC

- G06F 9/545: {where tasks reside in different layers, e.g. user- and kernel-space}
- G06F 9/45533: {Hypervisors; Virtual machine monitors}
- G06F 9/45537: {Provision of facilities of other operating environments, e.g. WINE (I/O emulation G06F13/105)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Various technologies and techniques are disclosed for virtualizing threads. An operating system thread is virtualized by intercepting accesses of the operating system thread state and emulating a normal operating system behavior. A kernel mode thread state is virtualized by intercepting kernel accesses of the kernel mode thread state and emulating a normal kernel mode behavior. A user mode thread state is virtualized by intercepting user mode accesses of the user mode thread state and emulating a normal user mode behavior. If the access is a write access, then the write access is applied to a virtual thread structure. If the access is a read access, then the read access is applied to the virtual thread structure.

## Claims

### Claim 1

A computer-readable medium having computer-executable instructions for causing a computer to perform steps comprising:
virtualize an operating system thread by intercepting accesses of the operating system thread state and emulating a normal operating system behavior;
virtualize a kernel mode thread state by intercepting kernel accesses of the kernel mode thread state and emulating a normal kernel mode behavior; and
virtualize a user mode thread state by intercepting user mode accesses of the user mode thread state and emulating a normal user mode behavior.

### Claim 2 (depends on 1)

The computer-readable medium of claim 1, further having computer-executable instructions for causing a computer to perform steps comprising:
select a kernel thread to run a user thread based on a current virtualized state of the user thread.

### Claim 3 (depends on 1)

The computer-readable medium of claim 1, further having computer-executable instructions for causing a computer to perform steps comprising:
modify a kernel thread to run a user thread based on a current virtualized state of the user thread.

### Claim 4 (depends on 1)

The computer-readable medium of claim 1, further having computer-executable instructions for causing a computer to perform steps comprising:
enable a user mode execution context to make use of all system services.

### Claim 5 (depends on 1)

The computer-readable medium of claim 1, wherein the kernel mode thread state is virtualized by trapping system call entries.

### Claim 6 (depends on 1)

The computer-readable medium of claim 1, wherein a read of operating system thread state is virtualized by applying the read to a virtual thread structure.

### Claim 7 (depends on 1)

The computer-readable medium of claim 1, wherein a write of operating system thread state is virtualized by applying the write to a virtual thread structure.

### Claim 8 (depends on 1)

The computer-readable medium of claim 1, wherein a read of kernel mode thread state is virtualized by selecting a kernel thread block associated with a virtual thread and performing the read from the kernel thread block.

### Claim 9 (depends on 1)

The computer-readable medium of claim 1, wherein a write of kernel mode thread state is virtualized by selecting a kernel thread block associated with a virtual thread and performing the write from the kernel thread block.

### Claim 10 (depends on 1)

The computer-readable medium of claim 1, wherein a read of user mode thread state is virtualized by selecting a user thread block associated with a virtual thread and performing the read from the user thread block.

### Claim 11 (depends on 1)

The computer-readable medium of claim 1, wherein a write of user mode thread state is virtualized by selecting a user thread block associated with a virtual thread and performing the write from the user thread block.

### Claim 12 (depends on 1)

The computer-readable medium of claim 1, wherein a virtual thread structure is used for the virtualization of the operating system thread state, the kernel mode thread state, and the user mode thread state.

### Claim 13 (depends on 12)

The computer-readable medium of claim 12, wherein the virtual thread structure uses user mode execution when possible.

### Claim 14

A method for virtualizing an operating system thread comprising the steps of:
intercepting an access of operating system thread state;
if the access is a write access, then applying the write access to a virtual thread structure; and
if the access is a read access, then applying the read access to the virtual thread structure.

### Claim 15 (depends on 14)

The method of claim 14, wherein the virtual thread structure uses user mode execution when possible.

### Claim 16 (depends on 14)

A computer-readable medium having computer-executable instructions for causing a computer to perform the steps recited in claim 14.

### Claim 17

A method for virtualizing a thread state comprising the steps of:
intercepting an access to thread state; and
selecting a thread block associated with a virtual thread and performing the intercepted access using the thread block.

### Claim 18 (depends on 17)

The method of claim 17, wherein the access is a kernel access to kernel mode thread state, and wherein the thread block is a kernel thread block.

### Claim 19 (depends on 17)

The method of claim 17, wherein the thread state is user mode thread state, and wherein the thread block is a user mode thread block.

### Claim 20 (depends on 17)

A computer-readable medium having computer-executable instructions for causing a computer to perform the steps recited in claim 17.
