Patent ID: 7191444

Claim:
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.