Patent US5727178A successfully refreshed from Google Patents.
← Back to Patent Explorer
US5727178A Expired / Lapsed US ⏱️ 0.0 years remaining

System and method for reducing stack physical memory requirements in a multitasking operating system

Assignee: Microsoft Technology Licensing LLC
•
Filing: 1996-12-05
•
Granted: 1998-03-10
•
Expires: 2016-12-05
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract An operating system component allocates locked stack memory pages to threads on an as needed basis. Each thread has a permanent locked stack. A second locked stack page is mapped to each thread. If a thread is using the assignable locked stack page when the system scheduler switches away from that thread, the assignable stack page becomes owned by that thread. When the system scheduler switches to a thread the assignable stack page mapped to that thread is checked to see if it is owned by another thread. If so, an unowned assignable stack page is mapped to the thread prior to switching to that thread. The size of the pool of locked assignable stack pages is adjusted dynamically. If the number of unowned assignable stack pages exceeds a threshold, locked stack pages are released. If the number of locked assignable stack pages falls below a predetermined number, additional assignable stack pages are allocated.

Inventors

  • 👤 Richard Allen Pletcher
  • 👤 Ralph Allen Lipe

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-11-02 18:50
CPC Classifications
G; G06; G06F; G06F9/00; G06F9/06; G06F9/46; G06F9/50; G06F9/5005; G06F9/5011; G06F9/5016

Claims Analysis

Total Claims: 28
Claim 1
Independent Claim 102 words
In a multitasking operating system managing a plurality of threads, a method for allocating memory to one of the threads, comprising the steps of: creating a first thread; mapping a first memory page to the first thread; mapping a second memory page to the first thread; executing a second thread; receiving an indication to switch from the second thread to the first thread; determining whether the second memory page is available to the first thread; if the second memory page is not available to the first thread, mapping a third memory page to the first thread; and switching to the first thread.
Claim 2
Dependent Claim 102 words
In a multitasking operating system managing a plurality of threads, a method for allocating memory to one of the threads, comprising the steps of: creating a first thread; mapping a first memory page to the first thread; mapping a second memory page to the first thread; executing a second thread; receiving an indication to switch from the second thread to the first thread; determining whether the second memory page is available to the first thread; if the second memory page is not available to the first thread, mapping a third memory page to the first thread; and switching to the first thread.
Claim 3
Dependent Claim 40 words
A method for allocating memory as recited in claim 1, wherein determining whether the second memory page is available to the first thread comprises determining whether the second memory page is owned by a thread other than the first thread.
Claim 4
Dependent Claim 47 words
A method for allocating memory as recited in claim 1, further comprising the steps of: determining whether the number of available memory pages exceeds a predetermined threshold; and adding an additional available memory page if the number of available memory pages does not exceed the predetermined threshold.
Claim 5
Dependent Claim 137 words
In a multitasking operating system managing a plurality of threads, a method for allocating memory to one of the threads, comprising the steps of: creating a first thread; creating a second thread; creating a plurality of assignable memory pages, including a first assignable memory page and a second assignable memory page; mapping the first assignable memory page to the first and second threads; executing the first thread; receiving an indication to switch from the first thread to the second thread; determining, in response to the indication, whether the first thread is using the first assignable memory page; if the first thread is using the first assignable memory page, preventing the second thread from using the first assignable memory page, otherwise, allowing the second thread to use the first assignable memory page; and switching to the second thread.
Claim 6
Dependent Claim 137 words
In a multitasking operating system managing a plurality of threads, a method for allocating memory to one of the threads, comprising the steps of: creating a first thread; creating a second thread; creating a plurality of assignable memory pages, including a first assignable memory page and a second assignable memory page; mapping the first assignable memory page to the first and second threads; executing the first thread; receiving an indication to switch from the first thread to the second thread; determining, in response to the indication, whether the first thread is using the first assignable memory page; if the first thread is using the first assignable memory page, preventing the second thread from using the first assignable memory page, otherwise, allowing the second thread to use the first assignable memory page; and switching to the second thread.
Claim 7
Dependent Claim 55 words
A method for allocating memory as recited in claim 4, further comprising the step of mapping a first permanent memory page to the first thread, and wherein determining whether the first thread is using the first assignable memory page comprises determining whether the first thread's stack pointer is pointing to the first permanent memory page.
Claim 8
Dependent Claim 31 words
A method for allocating memory as recited in claim 4, wherein determining whether the first thread is using the first assignable memory page comprises determining whether a predetermined flag is set.
Claim 9
Dependent Claim 36 words
A method for allocating memory as recited in claim 4, further comprising the step of mapping the second assignable memory page to the second thread if the first thread is using the first assignable memory page.
Claim 10
Independent Claim 180 words
A method for allocating locked stack pages among a plurality of threads running in an operating system, comprising the steps of: creating a first thread; mapping a first permanent stack page to the first thread; creating a second thread; mapping a second permanent stack page to the second thread; creating a plurality of assignable stack pages, including a first assignable stack page and a second assignable stack page; mapping the first assignable stack page to the first and second threads; executing the first thread; receiving an indication to switch from the first thread to the second thread; determining, in response to the indication, whether the first thread is using the first assignable stack page; if the first thread is using the first assignable stack page, indicating that the first assignable stack page is owned by the first thread; determining whether the first assignable stack page is available to the second thread; if the first assignable stack page is not available to the second thread, mapping the second assignable stack page to the second thread; and switching to the second thread.
Claim 11
Independent Claim 180 words
A method for allocating locked stack pages among a plurality of threads running in an operating system, comprising the steps of: creating a first thread; mapping a first permanent stack page to the first thread; creating a second thread; mapping a second permanent stack page to the second thread; creating a plurality of assignable stack pages, including a first assignable stack page and a second assignable stack page; mapping the first assignable stack page to the first and second threads; executing the first thread; receiving an indication to switch from the first thread to the second thread; determining, in response to the indication, whether the first thread is using the first assignable stack page; if the first thread is using the first assignable stack page, indicating that the first assignable stack page is owned by the first thread; determining whether the first assignable stack page is available to the second thread; if the first assignable stack page is not available to the second thread, mapping the second assignable stack page to the second thread; and switching to the second thread.
Claim 12
Dependent Claim 40 words
A method for allocating locked stack pages as recited in claim 8, wherein determining whether the first assignable stack page is available to the second thread comprises determining whether the first assignable stack page is owned by the first thread.
Claim 13
Dependent Claim 48 words
A method for allocating locked stack pages as recited in claim 8, wherein determining whether the first assignable stack page is available to the second thread comprises determining whether the first assignable stack page is owned by one of the plurality of threads other than the second thread.
Claim 14
Dependent Claim 41 words
A method for allocating locked stack pages as recited in claim 8, wherein determining whether the first thread is using the first assignable stack page comprises determining whether the first thread's stack pointer is pointing to the first permanent stack page.
Claim 15
Dependent Claim 33 words
A method for allocating locked stack pages as recited in claim 8, wherein determining whether the first thread is using the first assignable stack page comprises determining whether a predetermined flag is set.
Claim 16
Dependent Claim 31 words
A method for allocating locked stack pages as recited in claim 12, wherein the predetermined flag is set by the operating system when the first thread has jumped to another stack.
Claim 17
Dependent Claim 57 words
A method for allocating locked stack pages as recited in claim 8, further comprising the steps of: determining, if the first thread is not using the first assignable stack page, whether the first thread owns the first assignable stack page; and freeing the first assignable stack page if the first thread owns the first assignable stack page.
Claim 18
Dependent Claim 51 words
A method for allocating locked stack pages as recited in claim 8, further comprising the steps of: determining whether the number of unowned assignable stack pages exceeds a predetermined number; and releasing one of the unowned assignable stack pages if the number of unowned assignable stack pages exceeds the predetermined number.
Claim 19
Dependent Claim 141 words
A computer-readable medium having computer-executable instructions for performing steps comprising: creating a first thread; mapping a first memory page to the first thread; creating a second thread; mapping a second memory page to the second thread; mapping a third memory page to the first and second threads; executing the first thread; receiving an indication to switch from the first thread to the second thread; determining, in response to the indication, whether the first thread is using the third memory page; if the first thread is using the third memory page, indicating that the third memory page is owned by the first thread; determining whether the third memory page is available to the second thread; if the third memory page is not available to the second thread, mapping a fourth memory page to the second thread; and switching to the second thread.
Claim 20
Dependent Claim 141 words
A computer-readable medium having computer-executable instructions for performing steps comprising: creating a first thread; mapping a first memory page to the first thread; creating a second thread; mapping a second memory page to the second thread; mapping a third memory page to the first and second threads; executing the first thread; receiving an indication to switch from the first thread to the second thread; determining, in response to the indication, whether the first thread is using the third memory page; if the first thread is using the third memory page, indicating that the third memory page is owned by the first thread; determining whether the third memory page is available to the second thread; if the third memory page is not available to the second thread, mapping a fourth memory page to the second thread; and switching to the second thread.
Claim 21
Dependent Claim 32 words
The computer-readable medium of claim 16, wherein determining whether the third memory page is available to the second thread comprises determining whether the third memory page is owned by the first thread.
Claim 22
Dependent Claim 33 words
The computer-readable medium of claim 16, wherein determining whether the first thread is using the third memory page comprises determining whether the first thread's stack pointer is pointing to the first memory page.
Claim 23
Dependent Claim 47 words
The computer-readable medium of claim 16, further comprising the steps of: determining, if the first thread is not using the third memory page, whether the first thread owns the third memory page; and freeing the third memory page if the first thread owns the third memory page.
Claim 24
Dependent Claim 30 words
The computer-readable medium of claim 16, wherein the first and second memory pages are permanent locked stack pages and the third and fourth memory pages are assignable locked stack pages.
Claim 25
Dependent Claim 118 words
In a computer having memory and an operating system, a system for allocating the memory among a plurality of threads managed by the operating system, comprising: a processing unit; the processing unit being operative to: create a first thread and a first permanent page mapped to the first thread; map a first assignable stack page to the first thread; execute a second thread; receive an indication to switch from the second thread to the first thread; determine whether the first assignable stack page is available to the first thread; if the first assignable stack page is not available to the first thread, map a second assignable stack page to the first thread; and switch to the first thread.
Claim 26
Dependent Claim 118 words
In a computer having memory and an operating system, a system for allocating the memory among a plurality of threads managed by the operating system, comprising: a processing unit; the processing unit being operative to: create a first thread and a first permanent page mapped to the first thread; map a first assignable stack page to the first thread; execute a second thread; receive an indication to switch from the second thread to the first thread; determine whether the first assignable stack page is available to the first thread; if the first assignable stack page is not available to the first thread, map a second assignable stack page to the first thread; and switch to the first thread.
Claim 27
Dependent Claim 40 words
The system of claim 21, wherein the processing unit determines whether the first assignable stack page is available to the first thread by determining whether the first assignable stack page is owned by a thread other than the first thread.
Claim 28
Dependent Claim 46 words
The system of claim 21, wherein the processing unit is further operative to: determine whether the number of assignable stack pages exceeds a predetermined threshold; and add an additional assignable stack page if the number of available assignable stack pages does not exceed the predetermined threshold.

References Cited (Backward Citations)

US4926322A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 2001-03-09 2001-09-08 2002-03-10 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2005-03-09 2005-09-08 2006-03-10 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2009-03-09 2009-09-08 2010-03-10 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag