# US 2008/0313372 A1 · Method of Receiving a Message Processable by a Component on One of Plurality of Processing Threads

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

- Number: US 2008/0313372 A1
- Document ID: US20080313372A1
- Status: Published application
- Kind: A1
- Application number: 11/764,353
- Filed: 2007-06-18
- Published: 2008-12-18
- Earliest claimed: 2007-06-18
- Assignees: International Business Machines Corporation
- Inventors: Pamela H. Fong; Simon A.J. Holdsworth
- Web page: https://patentgrep.com/patent/US20080313372A1

## CPC

- G06F 9/546: {Message passing systems or structures, e.g. queues}
- G06F 2209/547: Messaging middleware
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

There is disclosed a method, apparatus and computer program product for receiving a message, the message being processable by a component on one of a plurality of processing threads. A message is received from a first component on a current thread. The communication style that was used by the first component is determined. Responsive to receipt of the message, the communication style that is desired to be used by a second component is determined. Responsive to determining that the two components are asynchronous, communication takes place with the second component using the current thread.

## Claims

### Claim 1

A method in a data processing system of receiving a message, the message being processable by a component on one of a plurality of processing threads, the method comprising:
receiving a message from a first component on a current thread;
determining the communication style that was used by the first component;
responsive to receipt of the message determining the communication style that is desired to be used by a second component; and
responsive to determining that the two components are asynchronous, communicating with the second component using the current thread.

### Claim 2 (depends on 1)

The method of claim 1, wherein the receiving step comprises:
receiving a request message from the first component;
wherein the step of determining the communication style that was used by the first component comprises determining the invocation style of the first component; and
wherein the step of communicating with the second component using the current thread comprises invoking the second component using the current thread.

### Claim 3 (depends on 2)

The method of claim 2 further comprising:
responsive to determining in a request interaction that one of the components is synchronous while the other is asynchronous, performing a thread switch from the current thread on which the request was received to a new thread by dispatching a new thread to continue processing of the request message.

### Claim 4 (depends on 1)

The method of claim 1 further comprising:
responsive to determining that the two components in a request interaction are synchronous, invoking the second component using the current thread on which the request was received such that logic of the second component is executed on said current thread.

### Claim 5 (depends on 1)

The method of claim 1 further comprising:
responsive to determining that the first component is synchronous and the second component is asynchronous in a request interaction, placing the request on a queue using the current thread on which the request was received, the first component waiting blocked for a reply to be received on that current thread; and
retrieving the request from the queue using a new thread, for processing by the asynchronous component using that new thread.

### Claim 6 (depends on 1)

The method of claim 1 further comprising:
responsive to determining that the first component is asynchronous and the second component is synchronous, placing the message for a request on a queue using the current thread on which the message was received such that the first component can continue processing the request on that current thread; and
retrieving the message from the queue using a new thread such that the synchronous second component can start processing the request on that new thread.

### Claim 7 (depends on 1)

The method of claim 1, wherein the communication style used by the first component in a request interaction is based on the protocol used by the first component.

### Claim 8 (depends on 1)

The method of claim 1, wherein the communication style used by the first component in a request interaction is based on information received in the message at the first component.

### Claim 9 (depends on 1)

The method of claim 1, wherein the communication style desired to be used by the second component in a request interaction is based on component implementation information.

### Claim 10 (depends on 1)

The method of claim 1, wherein the communication style desired to be used by the second component in a request interaction is based on information received in a message asking for details of the communication style of the second component.

### Claim 11 (depends on 1)

The method of claim 1, wherein the receiving step further comprises:
receiving a reply from the first component on the current thread.

### Claim 12 (depends on 11)

The method of claim 11 comprising:
responsive to determining that said first component is asynchronous and the second component to which the reply is to be sent is synchronous, performing a thread switch from the current thread on which the reply was received to a new thread by dispatching a new thread to continue processing the reply.

### Claim 13 (depends on 11)

The method of claim 11 further comprising:
responsive to determining that the two components in a reply interaction are asynchronous, passing the reply on the current thread on which the reply was received.

### Claim 14 (depends on 11)

The method of claim 11 further comprising:
responsive to determining that the two components in a reply interaction are synchronous, passing the reply from the first component to the second component on the current thread on which the reply was received.

### Claim 15 (depends on 11)

The method of claim 11 further comprising:
responsive to determining that the first component is synchronous and the second component is asynchronous in a reply interaction, placing the reply on a queue using the current thread on which the reply was received and releasing the current thread; and
dispatching a new thread to retrieve the reply from the queue for processing by the asynchronous second component using that new thread.

### Claim 16 (depends on 11)

The method of claim 11 comprising:
responsive to determining that the first component is synchronous and the second component is asynchronous in a reply interaction, and responsive to determining that the thread on which the second component invoked the first component in the corresponding request interaction is available, passing the reply to the second component on the available thread.

### Claim 17 (depends on 11)

The method of claim 11 comprising:
responsive to determining that said first component is asynchronous and said second component is synchronous in a reply interaction, resuming a blocked thread of the second component to receive the reply.

### Claim 18

Am apparatus for receiving a message, the message being processable by a component on one of a plurality of processing threads, the apparatus comprising:
means for receiving a message from a first component on a current thread;
means for determining the communication style that was used by the first component;
means, responsive to receipt of the message, for determining the communication style that is desired to be used by a second component; and
means, responsive to determining that the two components are asynchronous, for communicating with the second component using the current thread.

### Claim 19 (depends on 18)

The apparatus of claim 18, wherein the receiving means comprises:
means for receiving a request message from the first component;
wherein the means for determining the communication style that was used by the first of the message comprises means for determining the invocation style of the first component; and
wherein the means for communicating with the second component using the current thread comprises means for invoking the second component using the current thread.

### Claim 20

A computer program product in a computer readable medium for receiving a message, the message being processable by a component on one of a plurality of processing threads, the computer program product comprising computer instructions operable when run on a computer to perform the steps of:
receiving a message from a first component on a current thread;
determining the communication style that was used by the first component;
responsive to receipt of the message determining the communication style that is desired to be used by a second component; and
responsive to determining that the two components are asynchronous, communicating with the second component using the current thread.
