# US 2021/0081264 A1 · Ensuring Thread Affinity for Interprocess Communication in a Managed Code Environment

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

- Number: US 2021/0081264 A1
- Document ID: US20210081264A1
- Status: Published application
- Kind: A1
- Application number: 17/108,414
- Filed: 2020-12-01
- Published: 2021-03-18
- Earliest claimed: 2010-03-08
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Jackson M. DAVIS; John A. SHEPARD
- Web page: https://patentgrep.com/patent/US20210081264A1

## CPC

- G06F 9/547: {Remote procedure calls [RPC]; Web services}
- G06F 9/546: {Message passing systems or structures, e.g. queues}
- H04L 67/1001: for accessing one among a plurality of replicated servers
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A remote procedure call channel for interprocess communication in a managed code environment ensures thread-affinity on both sides of an interprocess communication. Using the channel, calls from a first process to a second process are guaranteed to run on a same thread in a target process. Furthermore, calls from the second process back to the first process will also always execute on the same thread. An interprocess communication manager that allows thread affinity and reentrancy is able to correctly keep track of the logical thread of execution so calls are not blocked in unmanaged hosts. Furthermore, both unmanaged and managed hosts are able to make use of transparent remote call functionality provided by an interprocess communication manager for the managed code environment.

## Claims

### Claim at position 1

1-18. (canceled)

### Claim 19

A method comprising:
transmitting, from a first object to a second object, an interprocess message in a channel, wherein the first object is executing on a first process in a runtime managed environment and the second object is executing on a second process external to the first process, and wherein the channel is thread reentrant and enables thread affinity between the first process and the second process.

### Claim 20 (depends on 19)

The method of claim 19, wherein the first object and the second object are hosted on a Web Service.

### Claim 21 (depends on 19)

The method of claim 19, wherein the first object is exposed through a runtime callable wrapper (“RCW”).

### Claim 22 (depends on 21)

The method of claim 21, wherein the RCW acts as a proxy for the first object.

### Claim 23 (depends on 19)

The method of claim 19, further comprising:
installing a message filter to selectively control reentrancy.

### Claim 24 (depends on 19)

The method of claim 19, wherein the channel is implemented as a series of sinks.

### Claim 25 (depends on 19)

The method of claim 19, wherein the channel is a remote procedure call channel for interprocess communication.

### Claim 26 (depends on 25)

The method of claim 25, wherein the channel enables managed hosts and unmanaged hosts to use remote call functionality of the channel.

### Claim 27 (depends on 19)

The method of claim 19, wherein the first process executes a thread used to:
transmit the interprocess message from the first object to the second object; and
transmit a response message from the second object to the first object.

### Claim 28 (depends on 19)

The method of claim 19, wherein the first process is a host process and the second process is an add-in process.

### Claim 29 (depends on 19)

The method of claim 19, wherein the channel comprises one or more interprocess communication objects for processing the interprocess message before the interprocess message is transmitted to the second object.

### Claim 30 (depends on 29)

The method of claim 29, wherein processing the interprocess message comprises generating, in the first process, a proxy object for the second object, wherein calls to the proxy object are intercepted by a runtime environment associated with the channel.

### Claim 31 (depends on 19)

The method of claim 19, wherein the channel enables the first process to transmit additional messages while awaiting a response to the interprocess message from the second object.

### Claim 32

A system comprising:
at least one processor; and
a memory coupled to the at least one processor, the memory comprising computer executable instructions that, when executed by the at least one processor, causes the system to:
transmit, from a first object to a second object, an interprocess message in a channel, wherein the first object is executing on a first process in a runtime managed environment and the second object is executing on a second process external to the first process, and wherein the channel is thread reentrant and enables thread affinity between the first process and the second process.

### Claim 33 (depends on 32)

The system of claim 32, wherein the first object and the second object are hosted on a Web Service.

### Claim 34 (depends on 32)

The system of claim 32, wherein the first object is exposed through a runtime callable wrapper (“RCW”).

### Claim 35 (depends on 34)

The system of claim 34, wherein the RCW acts as a proxy for the first object.

### Claim 36 (depends on 32)

The system of claim 32, the computer executable instructions when executed by the at least one processor further causing the system to:
install a message filter to selectively control reentrancy.

### Claim 37 (depends on 32)

The system of claim 32, wherein the channel is implemented as a series of sinks.

### Claim 38

A device comprising at least one processor, the processor executing computer readable instructions for performing a method, comprising:
transmitting, from a first object to a second object, an interprocess message in a channel, wherein the first object is executing on a first process in a runtime managed environment and the second object is executing on a second process external to the first process, and wherein the channel is thread reentrant and enables thread affinity between the first process and the second process.
