×

Thread synchronization in a garbage-collected system using execution barriers

  • US 5,842,016 A
  • Filed: 05/29/1997
  • Issued: 11/24/1998
  • Est. Priority Date: 05/29/1997
  • Status: Expired due to Term
First Claim
Patent Images

1. A method in a computer system for synchronizing the execution of each of a plurality of threads with a garbage collection process, the method comprising the steps of:

  • for each thread,before the thread enters a series of instructions that interacts with references to garbage-collected objects, under the control of the thread, calling a first application programming interface (API) for disabling garbage collection if garbage collection is not already in progress, the first API returning immediately if called before garbage collection is initiated and returning only after garbage collection has completed if called after garbage collection is initiated;

    before the thread enters a series of instructions that does not interact with references to garbage-collected objects, under the control of the thread, calling a second application programming interface (API) for enabling garbage collection, the second API returning immediately;

    in a garbage collection thread, receiving a request to initiate garbage collection;

    in response to the request, identifying threads that have enabled garbage collection more recently than they have disabled garbage collection;

    after the identifying step, until all threads are identified or suspended,identifying threads that enable garbage collection, andsuspending threads that disable garbage collection; and

    when all threads are identified or suspended,performing garbage collection, andsuspending identified threads that disable garbage collection during the performance of garbage collection.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×