# US 2012/0254880 A1 · Thread folding tool

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

- Number: US 2012/0254880 A1
- Document ID: US20120254880A1
- Status: Published application
- Kind: A1
- Application number: 13/428,408
- Filed: 2012-03-23
- Published: 2012-10-04
- Earliest claimed: 2009-11-23
- Assignees: International Business Machines Corporation
- Inventors: KIRK J. KRAUSS
- Web page: https://patentgrep.com/patent/US20120254880A1

## CPC

- G06F 9/46: Multiprogramming arrangements
- G06F 9/48: Program initiating; Program switching, e.g. by interrupt
- G06F 9/4843: {by program, e.g. task dispatcher, supervisor, operating system}
- G06F 9/485: {Task life-cycle, e.g. stopping, restarting, resuming execution (G06F9/4881 takes precedence)}
- G06F 9/52: Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F 11/3017: {where the computing system is implementing multitasking (multiprogramming arrangements G06F9/46; allocation of resources G06F9/50)}
- G06F 11/3072: {where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting}
- G06F 11/3089: {Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents (software debugging using additional hardware using a specific debug interface G06F11/3656; performance evaluation by tracing or monitoring G06F11/3466)}
- G06F 11/3612: {by runtime analysis (performance monitoring G06F11/3466)}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 11/3644: {by instrumenting at runtime}
- G06F 2201/865: Monitoring of software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer-implemented method of performing runtime analysis on and control of a multithreaded computer program. One embodiment of the present invention can include identifying threads of a computer program to be analyzed. Under control of a supervisor thread, a plurality of the identified threads can be folded together to be executed as a folded thread. The execution of the folded thread can be monitored to determine a status of the identified threads. An indicator corresponding to the determined status of the identified threads can be presented in a user interface that is presented on a display.

## Claims

### Claim 1

A computer-implemented method of performing runtime analysis and runtime control of a multithreaded computer program, the method comprising:
identifying threads of a computer program to be analyzed;
under control of a supervisor thread, folding a plurality of the identified threads together to be executed as a single folded thread;
monitoring the execution of the folded thread to determine a status of the identified threads; and
presenting in a user interface that is presented on a display at least one indicator corresponding to the determined status of the identified threads.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
storing state data of a first of the identified threads to a memory location.

### Claim 3 (depends on 2)

The method of claim 2, wherein storing the state data of a first of the identified threads to a memory location comprises:
storing the state data to a memory location indicated by a thread tracking structure associated with the first thread.

### Claim 4 (depends on 1)

The method of claim 1, wherein folding a plurality of the identified threads together to be executed as a folded thread comprises:
copying state data of a second of the identified threads and applying the copied state data to be used as state data for a first of the identified threads.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
selecting as the second thread a thread that is next to the first thread in a list of folded threads.

### Claim 6 (depends on 4)

The method of claim 4, wherein applying the copied state data to be used as state data for the first thread comprises:
storing the copied state data to a memory location indicated by a thread tracking structure associated with the first thread.

### Claim 7 (depends on 3)

The method of claim 3, further comprising:
suspending the first thread; and
suspending the second thread;
wherein copying the state data is performed by a supervisor thread while both the first and second threads are suspended.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
re-initiating execution of the first thread.

### Claim 9 (depends on 1)

The method of claim 1, wherein identifying threads of the computer program to be analyzed comprises:
identifying in a list of folded threads a first of the threads that currently is executing; and
identifying a thread tracking structure associated with the first thread.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
receiving a user selection of at least a first of the identified threads and at least a second of the identified threads;
assigning the first thread to assume a context of the second thread; and
during execution of the identified threads, executing the first thread in lieu of the second thread when the second thread would otherwise be executed but for the first thread assuming the context.

### Claim at position 11

11-20. (canceled)
