Stack overflow prevention in parallel execution runtime

US9928105B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-9928105-B2
Application numberUS-82433110-A
CountryUS
Kind codeB2
Filing dateJun 28, 2010
Priority dateJun 28, 2010
Publication dateMar 27, 2018
Grant dateMar 27, 2018

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A parallel execution runtime prevents stack overflow by maintaining an inline counter for each thread executing tasks of a process. Each time that the runtime determines that inline execution of a task is desired on a thread, the runtime determines whether the inline counter for the corresponding thread indicates that stack overflow may occur. If not, the runtime increments the inline counter for the thread and allows the task to be executed inline. If the inline counter indicates a risk of stack overflow, then the runtime performs additional one or more checks using a previous stack pointer of the stack (i.e., a lowest known safe watermark), the current stack pointer, and memory boundaries of the stack. If the risk of stack overflow remains after all checks have been performed, the runtime prevents inline execution of the task.

First claim

Opening claim text (preview).

What is claimed is: 1. A method performed by a computer system, the method comprising: determining whether inline execution of a task on a first thread may cause a stack to overflow using a current stack pointer and a lowest known safe watermark, the determining performed by a runtime configured to allow the task to be executed concurrently with a set of other tasks from user code, the lowest known safe watermark is the deepest position in the stack by a previous stack pointer that was determined to be safe; preventing the task from being executed inline on the first thread in response to the determining that stack overflow may occur; in response to the determining that the current stack pointer and the lowest known safe watermark indicate that the inline execution may cause the stack to overflow, using the current stack pointer and a memory boundary of the stack to determine whether the inline execution will actually cause the stack to overflow; and executing the task inline on the first thread in response to determining that the current stack pointer and the memory boundary indicate that the inline execution will not cause the stack to overflow. 2. The method of claim 1 further comprising: executing the task with a second thread in response to determining that inline execution of the task on the first thread may cause the stack to overflow; and blocking the first thread until the task completes execution on the second thread. 3. The method of claim 1 further comprising: executing the task with the first thread in response to determining that inline execution of the task on the first thread will not cause the stack to overflow. 4. The method of claim 1 further comprising: determining whether the inline execution of the task on the first thread may cause the stack to overflow using an inline counter corresponding to the first thread. 5. The method of claim 4 further comprising: executing the task inline on the first thread in response to determining that the inline counter does not exceed a threshold; and incrementing the inline counter in response to the executing the task inline on the first thread. 6. The method of claim 5 further comprising: decrementing the inline counter in response to the task returning from execution on the first thread. 7. The method of claim 1 further comprising: determining whether the inline execution of the task on the first thread may cause the stack to overflow using a memory boundary of the stack queried from an operating system. 8. The method of claim 1 further comprising: executing the task with a second thread in response to determining that the current stack pointer and the memory boundary indicate that the inline execution may cause the stack to overflow. 9. A method performed by a computer system, the method comprising: maintaining an inline counter corresponding to a first thread that identifies a number of inline executions being performed by the first thread; determining, with the inline counter, whether inline execution of a task on the first thread may cause a stack to overflow, the determining performed by a runtime configured to allow the task to be executed concurrently with a set of other tasks from user code; determining, using a current stack pointer and a lowest known safe watermark, whether the inline execution of the task on the first thread may cause the stack to overflow, the lowest known safe watermark is the deepest position in the stack by a previous stack pointer that was determined to be safe; preventing the task from being executed inline on the first thread in response to the determining that stack overflow may occur; in response to the determining that the current stack pointer and the lowest known safe watermark indicate that the inline execution may cause the stack to overflow, using the current stack pointer and a memory boundary of the stack to determine whether the inline execution will actually cause the stack to overflow; and executing the task inline on the first thread in response to determining that the current stack pointer and the previous stack pointer indicate that the inline execution will not cause the stack to overflow. 10. The method of claim 9 further comprising: executing the task inline on the first thread in response to determining that the inline counter indicates that the inline execution will not cause the stack to overflow. 11. The method of claim 9 further comprising: incrementing the inline counter in response to executing the task inline on the first thread. 12. The method of claim 9 further comprising: decrementing the inline counter in response to the task returning from execution on the first thread. 13. A computer readable storage medium, which does not include transitory propagating signals, storing computer-executable instructions that, when executed by a computer system, perform a method comprising: comparing an inline counter corresponding to a first thread to a first threshold in response to determining that inline execution of a task on the first thread is desired; comparing a current stack pointer and a previous stack pointer that was determined to be safe in response to the inline counter exceeding the first threshold; executing the task inline on the first thread in response to the inline counter being less than the first threshold; and incrementing the inline counter in response to executing the task inline on the first thread. 14. The computer readable storage medium of claim 13 , the method further comprising: executing the task inline on the first thread in response to the current stack pointer being above the previous stack pointer. 15. The computer readable storage medium of claim 14 , the method further comprising: in response to the current stack pointer being below the previous stack pointer, comparing the current stack pointer to a memory boundary of the stack; and executing the task inline on the first thread in response to an amount of memory space between the current stack pointer and the memory boundary exceeding a second threshold. 16. The computer readable storage medium of claim 15 , the method further comprising: storing the current stack pointer as a lowest known safe watermark in response to the amount of memory space exceeding the second threshold. 17. The computer readable storage medium of claim 16 , the method further comprising: in response to the amount of memory space not exceeding the second threshold, executing the task with a second thread.

Assignees

Inventors

Classifications

  • Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators · CPC title

  • Error avoidance (G06F11/07 and subgroups take precedence) · CPC title

  • Error or fault detection not based on redundancy (power supply failures G06F1/30; network fault management H04L41/06) · CPC title

  • Memory management, e.g. access or allocation · CPC title

  • G06F9/4843Primary

    by program, e.g. task dispatcher, supervisor, operating system · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US9928105B2 cover?
A parallel execution runtime prevents stack overflow by maintaining an inline counter for each thread executing tasks of a process. Each time that the runtime determines that inline execution of a task is desired on a thread, the runtime determines whether the inline counter for the corresponding thread indicates that stack overflow may occur. If not, the runtime increments the inline counter f…
Who is the assignee on this patent?
Yildiz Huseyin S, Duffy John J, Microsoft Technology Licensing Llc
What technology area does this patent fall under?
Primary CPC classification G06F9/4843. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Mar 27 2018 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).