IP Library Granted Patent US 8,589,943
Granted Patent B2
US 8,589,943 · App. 11/839,492 · Granted Nov 19, 2013

Multi-threaded processing with reduced context switching

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 8,589,943
App. No.
11/839,492
Granted
Nov 19, 2013
Kind
B2
Abstract

Multi-threaded processing with reduced context switching is disclosed. Context switches may be avoided through the use of pre-emption notification, a pre-emption wait time attribute and a no-context-save yield.

Claims (44)

1. In a computer system having one or more processors coupled to a memory, a method for multi-threaded processing, comprising:

notifying one or more of the processors running a first thread or thread group of a preemption by a second thread or thread group characterized by a higher priority than the first thread;

notifying the one or more of the processors of a time limit for pre-emption associated with the second thread or thread group; and,

if the first thread or thread group can complete its execution or save data that it needs to save before exiting or remove a lock on a mutex so that other threads may access the mutex after the first thread exits within the time limit, yielding the one or more of the processors to the second thread or thread group within the time limit without saving a context of the first thread or thread and, if the first thread or thread group cannot complete its execution or save data that it needs to save before exiting or remove a lock on a mutex so that other threads may access the mutex after the first thread exits within the time limit, performing a context switch from the first thread or thread group to the second thread or thread group.

2. A non-transitory computer-readable medium having a set of computer readable instructions embodied therein, the computer-readable instructions being configured to implement a method for a multi-threaded processing on a computer system having one or more processors coupled to a memory, the computer-readable instructions comprising:

one or more pre-emption-notification instructions that, when executed, notify one or more of the processors running a first thread or thread group of a pre-emption by a second thread or thread group characterized by a higher priority than the first thread or thread group;

one or more wait-time-notification instructions that, when executed, notify the first thread or thread group of a time limit for pre-emption associated with the second thread or thread group; and

one or more yield instructions that, when executed, yield the one or more of the processors to the second thread or thread group within the time limit without saving a context of the first thread or thread group if the processor can complete its execution or save data that it needs to save before exiting or remove a lock on a mutex so that other threads may access the mutex after the first thread exits within the time limit and, one or more switch instructions that, when executed, perform a context switch from the first thread or thread group to the second thread or thread group if the processor cannot complete its execution or save data that it needs to save before exiting or remove a lock on a mutex so that other threads may access the mutex after the first thread exits within the time limit.

3. The computer-readable medium of claim 2 wherein the pre-emption-notification instructions are part of an operating system for the computer system.

4. The computer-readable medium of claim 2 wherein the wait-time-notification instructions are part of an operating system for the computer system.

5. The computer-readable medium of claim 2 wherein the yield instructions include one or more instructions that are part of an operating system for the computer system.

6. The computer-readable medium of claim 2 wherein the yield instructions include one or more instructions that, when executed, unlock a mutex previously locked by the first thread or thread group before yielding the one or more of the processors to the second thread or thread group.

7. The computer-readable medium of claim 2 wherein the yield instructions include one or more instructions that, when executed, maintain the first thread in a ready state until a subsequent call to execute the first thread or thread group.

8. The computer-readable medium of claim 2 wherein the time limit is less than a time needed for a context switch from the first thread or thread group to the second thread or thread group.

9. The computer-readable medium of claim 2 , wherein the computer-readable instructions further comprise one or more instructions that, when executed, group the first thread with one or more other threads in a group characterized by a thread group type, wherein the thread group type is either a constant-sized group of two or more threads that are gang scheduled or a variable-sized group of two or more threads that can be scheduled and/or unscheduled one at a time.

10. The computer-readable medium of claim 9 wherein, if the thread group type is variable-sized, the yield instructions are configured to yield only the first thread and no other threads in the group if only the first thread is pre-empted.

11. The computer-readable medium of claim 9 wherein, if the thread group type is constant-sized, the yield instructions are configured to yield the first thread and all other threads in the group even if only the first thread is pre-empted.

12. The computer-readable medium of claim 2 wherein the context switch includes saving context data associated with the first thread in the memory.

13. The computer-readable medium of claim 2 wherein the yield instructions include one or more instructions that, when executed, schedule the second thread for execution on the one or more of the processors.

14. A computer system, comprising: one or more processors; and a memory coupled to the one or more processors, wherein the computer system is programmed with a set of computer-readable instructions configured to implement a method for a multi-threaded processing, the computer-readable instructions comprising:

one or more pre-emption-notification instructions that, when executed, notify one or more of the processors running a first thread or thread group of a pre-emption by a second thread or thread group characterized by a higher priority than the first thread or thread group;

one or more wait-time-notification instructions that, when executed, notify the one or more of the processors of a time limit for pre-emption associated with the second thread or thread group; and

one or more yield instructions that, when executed, yield the one or more of the processors to the second thread or thread group within the time limit without saving a context of the first thread or thread group if the one or more of the processors can complete its execution or save data that it needs to save before exiting or remove a lock on a mutex so that other threads may access the mutex after the first thread exits within the time limit and, one or more switch instructions that, when executed, perform a context switch from the first thread or thread group to the second thread or thread group if the one or more of the processors cannot complete its execution or save data that it needs to save before exiting or remove a lock on a mutex so that other threads may access the mutex after the first thread exits within the time limit.

15. The computer system of claim 14 wherein the one or more processors include two or more processors.

16. The computer system of claim 15 wherein the two or more processors include a power processor element and one or more synergistic processor elements.

17. The computer system of claim 14 wherein the pre-emption-notification instructions are part of an operating system for the computer system.

18. The computer system of claim 14 wherein the wait-time-notification instructions are part of an operating system for the computer system.

19. The computer system of claim 14 wherein the yield instructions include one or more instructions that are part of an operating system for the computer system.

20. The computer system of claim 14 wherein the yield instructions include one or more instructions that, when executed, unlock a mutex previously locked by the first thread or thread group before yielding the one or more of the processors to the second thread.

21. The computer system of claim 14 wherein the yield instructions include one or more instructions that, when executed, maintain the first thread or thread group in a ready state until a subsequent call to execute the first thread.

22. The computer system of claim 14 wherein the time limit is less than a time needed for a context switch from the first thread or thread group to the second thread or thread group.

23. The computer system of claim 14 , wherein the computer-readable instructions further comprise one or more instructions that, when executed, group the first thread with one or more other threads in a group characterized by a thread group type, wherein the thread group type is either a constant-sized group of two or more threads that are gang-scheduled or a variable-sized group of two or more threads that can be scheduled and/or unscheduled one at a time.

24. The computer system of claim 23 wherein, if the thread group type is variable-sized, the yield instructions are configured to yield only the first thread and no other threads in the group if only the first thread is pre-empted.

25. The computer system of claim 23 wherein, if the thread group type is constant-sized, the yield instructions are configured to yield the first thread and all other threads in the group even if only the first thread is pre-empted.

26. The computer system of claim 14 wherein the context switch includes saving context data associated with the first thread or thread group in the memory.

27. The computer system of claim 14 wherein the yield instructions include one or more instructions that, when executed, schedule the second thread or thread group for execution on the one or more of the processors.

28. The computer system of claim 14 wherein the one or more processors include a power processing element and one or more synergistic processing elements.

29. The computer system of claim 14 wherein the one or more processors include a multicore processor.

30. The computer system of claim 14 wherein the system is a component of a personal computer, laptop computer, hand-held internet browser device, hand-held email device, Voice over Internet Protocol (VoIP) phones, video game console, or hand-held video game device.

31. The computer system of claim 30 wherein the one or more processors include a power processing element and one or more synergistic processing elements and the device is a video game console.

32. The computer system of claim 14 wherein the one or more processors include an asymmetric multi-core processor.

33. The computer system of claim 32 wherein the multi-core processor includes one or more limited cores of a type that cannot perform a full thread context switch on itself.

34. The computer system of claim 33 wherein, if a context switch is required for one or more of the limited cores, one or more remaining cores of the multi-core processor must perform context switches in full or in part on behalf of the one or more limited cores requiring the context switch.

35. The computer system of claim 34 wherein a context switch of the limited core processor results in undesired overhead for the computer system.

Assignments (4)
CHANGE OF NAME Recorded Jul 1, 2016
From: SONY COMPUTER ENTERTAINMENT INC.
To: SONY INTERACTIVE ENTERTAINMENT INC.
Reel/Frame 039239/0356 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 27, 2011
From: SONY NETWORK ENTERTAINMENT PLATFORM INC.
To: SONY COMPUTER ENTERTAINMENT INC.
Reel/Frame 027557/0001 →
CHANGE OF NAME Recorded Dec 26, 2011
From: SONY COMPUTER ENTERTAINMENT INC.
To: SONY NETWORK ENTERTAINMENT PLATFORM INC.
Reel/Frame 027446/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 15, 2007
From: BATES, JOHN P.
To: SONY COMPUTER ENTERTAINMENT INC.
Reel/Frame 019700/0677 →