Stream management in a multithreaded environment
First Claim
1. A method in a computer system for returning a stream to a task executing an operating system call that is blocked, the computer system having a processor with multiple streams, each stream for executing instructions of a task, the method comprising:
- under control of a thread of the task executing on a first stream, making an operating system call; and
when the operating system call blocks,under control of the operating system executing on a second stream, invoking a function provided by the task to provide the second stream to the task;
under control of the invoked function, executing instructions of the task on the second stream; and
under control of the operating system, notifying the task when the operating system call is complete, wherein the notifying includes,invoking a function provided by the task using a stream of the operating system; and
under control of that invoked function,indicating that the operating system call is complete; and
invoking another operating system call to return the operating system stream to the operating system.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and system that prepares a task for being swapped out from processor utilization that is executing on a computer with multiple processors that each support multiple streams. The task has one or more teams of threads, where each team represents threads executing on a single processor. The task designates, for each stream that is executing a thread, one stream as a team master stream and one stream as a task master stream. For each team master stream, the task notifies the operating system that the team is ready to be swapped out when each other thread of the team has saved its state and has quit its stream. Finally, for the task master stream, the task notifies the operating system that the task is ready to be swapped when it has saved its state and each other team has notified that it is ready to be swapped out.
88 Citations
23 Claims
-
1. A method in a computer system for returning a stream to a task executing an operating system call that is blocked, the computer system having a processor with multiple streams, each stream for executing instructions of a task, the method comprising:
-
under control of a thread of the task executing on a first stream, making an operating system call; and when the operating system call blocks, under control of the operating system executing on a second stream, invoking a function provided by the task to provide the second stream to the task; under control of the invoked function, executing instructions of the task on the second stream; and under control of the operating system, notifying the task when the operating system call is complete, wherein the notifying includes, invoking a function provided by the task using a stream of the operating system; and under control of that invoked function, indicating that the operating system call is complete; and invoking another operating system call to return the operating system stream to the operating system. - View Dependent Claims (2, 3)
-
-
4. A system for providing a stream to a task executing an operating system call that is blocked, the system having a processor with multiple streams, each stream for executing instructions of a task, the system comprising:
-
a component that, under control of a thread of the task executing on a first stream, makes an operating system call that blocks; a component that, under control of the operating system executing on a second stream, invokes a function provided by the task to provide the second stream to the task; a component that, under control of the invoked function, executes instructions of the task on the second stream; and a component that, under control of the operating system, notifies the task when the operating system call is complete, wherein the notification includes; invoking a function provided by the task using a stream of the operating system; and under control of that invoked function, indicating that the operating system call is complete; and invoking another operating system call to return the operating system stream to the operating system. - View Dependent Claims (5, 6)
-
-
7. A method in a computer system for assigning a processor stream to a thread of a task, the method comprising:
-
under control of a thread of the task executing on a first processor stream, invoking an operating system call that will block and wait for the occurrence of an event; under control of the operating system, when the call is blocked, invoking a first routine of the task so that the routine can assign a second processor stream to another thread of the task; under control of the operating system, invoking a second routine of the task using a processor stream of the operating system to indicate that the operating system call is complete; and under control of the invoked second routine, invoking another operating system call to return the operating system processor stream to the operating system, wherein a processor stream is a component of a processor that supports multiple streams, each stream for executing instructions of a task. - View Dependent Claims (8, 9, 10)
-
-
11. A system for assigning a processor stream to a thread of a task, the system comprising:
-
a component for, under control of a thread of the task executing on a first processor stream, invoking an operating system call that will block and wait for the occurrence of an event; a component for, under control of the operating system, invoking a first routine of the task so that the routine can assign a second processor stream to another thread of the task; a component for, under control of the operating system, invoking a second routine of the task using a processor stream of the operating system to indicate that the operating system call is complete; and a component for, under control of the invoked second routine, invoking another operating system call to return the operating system processor stream to the operating system, wherein a processor stream is a component of a processor that supports multiple streams, each stream for executing instructions of a task. - View Dependent Claims (12, 13, 14)
-
-
15. A method in a computer system for returning a stream to a user program, the computer system having an operating system and a processor with multiple streams, each stream for executing instructions of a task, the method comprising:
under control of the operating system, when an operating system call in a stream will block, invoking a first function of the task that will return the stream to the task; and when the operating system call becomes unblocked, invoking a second function of the task to notify the task that the operating system call is complete, wherein the notifying includes, invoking a second function provided by the task using a stream of the operating system; and under control of that invoked function, indicating that the operating system call is complete; and invoking another operating system call to return the operating system stream to the operating system. - View Dependent Claims (16, 17, 18, 19, 20)
-
21. A method in a computer system for returning a stream to a user program, the computer system having an operating system and a processor with multiple streams, each stream for executing instructions of the user program, the method comprising:
-
under control of the user program, invoking an operating system call; executing the operating system call in a user stream of the user program; and under control of the operating system, when the operating system call will block, when a thread making the operating system call is locked, waiting for the operating system call to become unblocked; and when a thread making the operating system call is not locked, invoking a first function of the user program that will return the stream to the user program; under control of a trap handler routine, placing the thread in a blocked pool and selecting another thread to execute on the stream; and when the operating system call becomes unblocked, invoking a second function of the user program in a stream of the operating system to notify the program that the operating system call is complete, wherein the notifying includes, invoking a second function of the user program using a stream of the operating system; and under control of that invoked function, indicating that the operating system call is complete; and invoking another operating system call to return the operating system stream to the operating system. - View Dependent Claims (22, 23)
-
Specification