IP Library › Granted Patent US 9,928,124
Granted Patent B2
US 9,928,124 · App. 14/949,325 · Granted Mar 27, 2018

Reverting tightly coupled threads in an over-scheduled system

Inventor: Richard John Vagg (Winston Hills, AU)
Assignee: CANON KABUSHIKI KAISHA
G06F9/546G06F2209/548
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,928,124
App. No.
14/949,325
Granted
Mar 27, 2018
Kind
B2
Abstract

A computer implemented method of processing a first task and a second task, by processing, in a parallel processing mode, the first task using a producer thread and the second task using a consumer thread, the threads running concurrently and communicating using a message queue configured to store a number of messages produced by the producer thread to be processed by the consumer thread; successively processing, in a serial processing mode, both the first task and the second task using the producer thread, if at least one transition of an occupancy state of the message queue from substantially full to substantially empty is detected; and reverting to processing the tasks in the parallel processing mode if, while the tasks are being processed in the serial processing mode, the consumer thread is operating concurrently with the producer thread.

Claims (26)

1. A method of processing a task on a processor adapted to process a plurality of tasks, the method comprising the steps of:

processing the task by a producer thread and a consumer thread running concurrently, each thread executing at least a portion of the task, the threads communicating via a message queue comprising a plurality of messages produced by the producer thread to be processed by the consumer thread;

detecting a transition of an occupancy state of the message queue from a substantially full state to a substantially empty state, wherein the state of the message queue is determined—based on the plurality of messages in the message queue to be processed by the consumer thread, and the transition of an occupancy state of the message queue from a substantially full state to a substantially empty state is caused by a further task interfering with processing of the task; and

in the event of detecting the transition, processing the task sequentially by a single thread.

2. The method according to claim 1 , wherein detecting a transition of an occupancy state of the message queue further comprises determining a rate of change in the number of messages in the message queue produced by a first thread to be processed by a second thread.

3. The method according to claim 2 , wherein the task is processed sequentially in response to detecting that the determined rate of change exceeds a predetermined threshold.

4. The method according to claim 1 , wherein the further task interferes with processing of the task by the producer thread and the consumer thread running concurrently.

5. The method according to claim 1 , wherein the step of detecting the transition comprises the steps of:

sending a system call which (a) places the producer thread into an idle state if the occupancy state of the message queue becomes full, and subsequently (b) places the producer thread into an active state when the occupancy state of the message queue next becomes less than full; and

detecting occurrence of the transition if the occupancy state of the message queue is substantially empty when the producer thread is placed into said active state.

6. The method according to claim 1 , further comprising reverting to processing the task in a parallel processing mode by the producer thread and the consumer thread running concurrently if, while the task is being processed sequentially, the consumer thread is operating concurrently with the producer thread.

7. The method according to claim 6 , wherein the step of determining if the consumer thread is operating concurrently with the producer thread comprises the steps of:

sending a test message to the consumer thread; and

establishing that the consumer thread is operating concurrently with the producer thread if the test message remains in the message queue for less than a predetermined time.

8. The method according to claim 1 , comprising the steps of establishing that the system hosting the threads is over-scheduled if the transition is detected.

9. The method according to claim 1 , further comprising allocating, by an operating system executing of the computer, the producer thread and the consumer thread dependent upon a request from a software application for performing the task.

10. A non-transitory computer-readable storage medium storing a program for directing a plurality of processors to perform a method of processing a task on a processor adapted to process a plurality of tasks, the method comprising the steps of:

processing the task by a producer thread and a consumer thread running concurrently, each thread executing at least a portion of the task, the threads communicating via a message queue comprising a plurality of messages produced by the producer thread to be processed by the consumer thread;

detecting a transition of an occupancy state of the message queue from a substantially full state to a substantially empty state, wherein the state of the message queue is determined based on the plurality of messages in the message queue to be processed by the consumer thread, and the transition of an occupancy state of the message queue from a substantially full state to a substantially empty state is caused by a further task interfering with processing of the task; and

in the event of detecting the transition, processing the task sequentially by a single thread.

11. A system, comprising:

a plurality of processors; and

a memory storing a program for directing the plurality of processors to perform a method of processing a task on a processor adapted to process a plurality of tasks, the method comprising the steps of:

processing the task by a producer thread and a consumer thread running concurrently, each thread executing at least a portion of the task, the threads communicating via a message queue comprising a plurality of messages produced by the producer thread to be processed by the consumer thread;

detecting a transition of an occupancy state of the message queue from a substantially full state to a substantially empty state, wherein the state of the message queue is determined based on the plurality of messages in the message queue to be processed by the consumer thread, and the transition of an occupancy state of the message queue from a substantially full state to a substantially empty state is caused by a further task interfering with processing of the task; and

in the event of detecting the transition, processing the task sequentially by a single thread.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 10, 2016
From: VAGG, RICHARD JOHN
To: CANON KABUSHIKI KAISHA
Reel/Frame 040590/0038 →
Priority Claims (1)
AU 2014268246 · Nov 28, 2014 · national
Continuity (1)
Related Publication 20160154678A1 · Jun 2, 2016