# US 2014/0195739 A1 · Zero-copy caching

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

- Number: US 2014/0195739 A1
- Document ID: US20140195739A1
- Status: Published application
- Kind: A1
- Application number: 13/734,785
- Filed: 2013-01-04
- Published: 2014-07-10
- Earliest claimed: 2013-01-04
- Assignees: Microsoft Corporation
- Applicants: Microsoft Corporation
- Inventors: Jinsong Yu; Andrew E. Goodsell; F. Soner Terek; Christopher Wellington Brumme; Ahmed Hassan Mohamed
- Web page: https://patentgrep.com/patent/US20140195739A1

## CPC

- G06F 12/12: Replacement control
- G06F 9/544: {Buffers; Shared memory; Pipes}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Caching of an immutable buffer that has its data and address prevented from changing during the lifetime of the immutable buffer. A first computing entity maintains a cache of the immutable buffer and has a strong reference to the immutable buffer. So long as any entity has a strong reference to the immutable buffer, the immutable buffer is guaranteed to continue to exist for the duration of the strong reference. A second computing entity communicates with the first computing entity to obtain a strong reference to the immutable buffer and thereafter read data from the immutable buffer. Upon reading the data from the cache, the second computing entity demotes the strong reference to a weak reference to the immutable buffer. A weak reference to the immutable buffer does not guarantee that the immutable buffer will continue to exist for the duration of the weak reference.

## Claims

### Claim 1

A system comprising:
an immutable buffer that protects the data populated within the immutable buffer from changing during the lifetime of the immutable buffer, and also protects the immutable buffer from having its physical address changed during the lifetime of the immutable buffer;
a first computing entity that maintains a cache of the immutable buffer and has a strong reference to the immutable buffer, wherein so long as any entity has a strong reference to the immutable buffer, the immutable buffer is guaranteed to continue to exist for at least the duration of the strong reference for each entity that has the strong reference; and
a second computing entity that communicates with the first computing entity to obtain a strong reference to the immutable buffer and thereafter read data from the immutable buffer, wherein upon or after reading the data from the cache, the second computing entity demotes the strong reference to the immutable buffer to a weak reference to the immutable buffer, wherein a weak reference to the immutable buffer does not guarantee that the immutable buffer will continue to exist for the duration of the weak reference.

### Claim 2 (depends on 1)

The system in accordance with claim 1, wherein function calls cannot be placed between the first computing entity and the second computing entity, but rather an inter-process communication or a cross protection boundary communication is used for the first computing entity and the second computing entity to communicate.

### Claim 3 (depends on 1)

The system in accordance with claim 1, further comprising:
a view provider configured to give a different view of the immutable buffer to the first computing entity and the second computing entity.

### Claim 4 (depends on 1)

The system in accordance with claim 1, whereupon upon receiving a request to read from the immutable buffer while the weak reference to the cache still exists, the second computing entity determines whether the immutable buffer still exists, and if the immutable buffer still exists, converts the weak reference to the immutable buffer to a strong reference to the immutable buffer and reads the data without performing an inter-process or cross protection boundary communication with the first computing entity.

### Claim 5 (depends on 4)

The system in accordance with claim 4, wherein if the immutable buffer does not still exists, the second computing entity performs an inter-process or cross protection boundary communication with the first computing entity to thereby cause the first computing entity to re-create the immutable buffer and allowing the second computing entity to gain a strong reference to the immutable buffer and read from the immutable buffer.

### Claim 6 (depends on 1)

The system in accordance with claim 1, wherein the first computing entity maintains first statistics regarding frequency of access of immutable buffers within a cache, and wherein the second computing entity maintains second statistics regarding frequency of access of immutable buffers within the cache, the first and second statistics being different.

### Claim 7 (depends on 6)

The system in accordance with claim 6, wherein the first computing entity is configured to perform the following in order to perform eviction:
an act of using the first statistics to identify candidates for eviction amongst immutable buffers in the cache;
an act of conferring with the second statistics for at least the identified candidates; and
an act of making an eviction decision regarding the identified candidates with respect to each identified eviction candidate after conferring with the second statistics such that if the second statistics indicate more frequent access of the identified candidate, the identified candidate may be kept within the cache for the time being.

### Claim 8 (depends on 1)

The system in accordance with claim 1, wherein the system is a managed code system.

### Claim 9 (depends on 1)

The system in accordance with claim 1, wherein the system is an unmanaged system.

### Claim 10

A method for caching data from an immutable buffer, the method comprising:
an act of a first computing entity accessing a first strong reference to an immutable buffer, wherein the immutable buffer protects the data populated within the immutable buffer from changing during the lifetime of the immutable buffer, and the immutable buffer is also protected from having its physical address changed during the lifetime of the immutable buffer, wherein so long as any entity has a strong reference to the immutable buffer, the immutable buffer is guaranteed to continue to exist for at least the duration of the strong reference for each entity that has the strong reference;
an act of the first computing entity formulating a cache using data from the immutable buffer;
an act of the first computing entity providing a second strong reference to the second computing entity; and
an act of the first computing entity releasing the first strong reference when the first computing entity is completed with the cache.

### Claim 11 (depends on 10)

The method in accordance with claim 10, wherein the first and second computing entities operate in a managed code system.

### Claim 12 (depends on 10)

The method in accordance with claim 10, wherein the first and second computing entities operate in an unmanaged code system.

### Claim 13 (depends on 10)

The method in accordance with claim 10, wherein the first computing entity maintains first statistics regarding frequency of access of immutable buffers within a cache, and wherein the second computing entity maintains second statistics regarding frequency of access of immutable buffers within the cache, the first and second statistics being different.

### Claim 14 (depends on 13)

The method in accordance with claim 13, wherein the first computing entity is configured to perform the following in order to perform eviction:
an act of using the first statistics to identify candidates for eviction amongst immutable buffers in the cache;
an act of conferring with the second statistics for at least the identified candidates; and
an act of making an eviction decision regarding the identified candidates with respect to each identified eviction candidate after conferring with the second statistics such that if the second statistics indicate more frequent access of the identified candidate, the identified candidate may be kept within the cache for the time being.

### Claim 15

A method for caching data from an immutable buffer, the method comprising:
an act of a second computing entity obtaining a strong reference to an immutable buffer to which a first computing entity also has a strong reference in order to create a cache at the first computing entity, the immutable buffer protecting the data populated within the immutable buffer from changing during the lifetime of the immutable buffer, and also protects the immutable buffer from having its physical address changed during the lifetime of the immutable buffer, wherein so long as any entity has a strong reference to the immutable buffer, the immutable buffer is guaranteed to continue to exist for at least the duration of the strong reference for each entity that has the strong reference; and
an act of the second computing entity obtaining a strong reference to the immutable buffer;
while the second computing entity still has the strong reference to the immutable buffer, an act of reading data from the immutable buffer,
upon or after reading the data from the cache, an act of the second computing entity demoting the strong reference to the immutable buffer to a weak reference to the immutable buffer, wherein a weak reference to the immutable buffer does not guarantee that the immutable buffer will continue to exist for the duration of the weak reference.

### Claim 16 (depends on 15)

The method in accordance with claim 15, wherein function calls cannot be placed between the first computing entity and the second computing entity, but rather an inter-process communication or a cross protection boundary communication is used for the first computing entity and the second computing entity to communicate.

### Claim 17 (depends on 15)

The method in accordance with claim 15, further comprising:
an act of receiving a request to read from the immutable buffer.

### Claim 18 (depends on 17)

The method in accordance with claim 17, whereupon upon receiving the request to read from the immutable buffer while the weak reference to the cache still exists, the second computing entity performs an act of determining whether the immutable buffer still exists, and if the immutable buffer still exists, performs an act of converting the weak reference to the immutable buffer to a strong reference to the immutable buffer and reads the data without performing an inter-process or cross protection boundary communication with the first computing entity.

### Claim 19 (depends on 18)

The method in accordance with claim 18, wherein if the immutable buffer does not still exists, the second computing entity performs an inter-process or cross protection boundary communication with the first computing entity to thereby cause the first computing entity to re-create the immutable buffer and allowing the second computing entity to gain a strong reference to the immutable buffer and read from the immutable buffer.

### Claim 20 (depends on 1)

The method in accordance with claim 1, wherein the system is a managed code system.
