US20020052926A1

Thread suspension system and method using trapping instructions

Claim Score by NHIP

Read claim 21, the broadest

Abstract

By encoding an exception triggering value in storage referenced by an instruction in an otherwise unused slot (e.g., the delay slot of a delayed control transfer instruction or an unused instruction position in a VLIW-based architecture) coinciding with a safe point, an efficient coordination mechanism can be provided for multi-threaded code. Because the mechanism(s) impose negligible overhead when not employed and can be engaged in response to an event (e.g., a start garbage collection event), safe points can be defined at call, return and/or backward branch points throughout mutator code to reduce the latency between the event and suspension of all threads. Though particularly advantageous for thread suspension to perform garbage collection at safe points, the techniques described herein are more generally applicable to program suspension at coordination points coinciding with calls, returns, branches or calls, returns and branches therein.

US20020052926A1, drawing sheet 1
Sheet 1 of 7

Term

Term ended

Projected expiry passed 23 September 2020, 6 years ago.

  1. Priority
  2. Filed
  3. Published
  4. Projected expiry
  5. Today

49 claims: 8 independent, 41 dependent

  1. 1
    A computer program product encoded in at least one computer readable medium, the computer program product comprising:mutator code executable by a processor and including an instruction that coincides with a safe point in an execution path thereof, the instruction explicitly encoding parallelism amongst multiple component operations thereof, wherein, based on a settable state of the processor, one of the operations of the instruction selectively triggers suspension of the mutator code at the safe point.
  2. 15
    A method of suspending a mutator at a safe point, the method comprising:executing mutator code including an instance of an instruction coinciding with the safe point, wherein the instruction instance references storage encodable with an exception triggering value to trigger an exception for suspending the mutator at the safe point;executing the instruction instance without the exception triggering value encoded in the storage;in response to a start garbage collection event, encoding the storage with the exception triggering value, and thereafter executing the instruction instance, thereby triggering the exception;and in response to the exception, suspending the mutator at the safe point.
  3. 21
    Broadest claimClaim Score 78, broad(NHIP)A computer program product encoded in computer readable media, the computer program product comprising:an instruction sequence including an operation that coincides with a safe point therein, wherein the operation is encoded in an otherwise unused position in the instruction sequence and is executable at least partially in parallel with one or more operations of the instruction sequence, the operation referencing a state that selectively triggers suspension of the instruction sequence at the safe point.
  4. 25
    A computer-implemented method of providing mutator code with support for suspension of at least one execution thread thereof at a safe point, the method comprising:encoding information accessible to a collector process to identify at least a portion of a root set of storage locations at a safe point in the execution sequence of instructions;and encoding in an otherwise unused operation position of an instruction instance that coincides with the safe point, a conditional trap operation that references storage encodable with an exception triggering value to trigger an exception for suspending execution of the mutator code at the safe point.
  5. 32
    A computer program product comprising:a compiler that generates an execution sequence of instructions including an explicit encoding of parallelism amongst component operations thereof, and which encodes in an otherwise unused component operation position an operation instance that references storage encodable with an exception triggering value to trigger an exception when the operation instance is executed as part of a mutator and to thereby suspend execution of the mutator at a safe point;and a map generator that supplies a collector process with information identifying a root set of storage locations in use by the mutator for pointer storage at the safe point, the safe point coinciding with the operation instance.
  6. 35
    A method of advancing plural threads to coordination points in respective execution paths thereof, the method comprising:encoding an exception triggering value in storage referenced by respective instances of one or more operations encoded in respective otherwise unused operation positions in each of the plural threads;for each of the plural threads, suspending execution thereof in response to execution of a respective operation instance, the respective operation instance coinciding with one of the coordination points therein.
  7. 42
    A method of coordinating garbage collection with execution of a multi-threaded mutator, wherein the garbage collection is performed at safe points in an execution trajectory of the multi-threaded mutator, and wherein potentially inconsistent threads of the multi-threaded mutator are suspended at the safe points to facilitate the garbage collection, the method comprising:upon a start garbage collection event, encoding an exception triggering value in storage referenced by exception triggering instructions in otherwise unused operation slots of instruction encodings that coincide with the safe points;thereafter, upon execution of the exception triggering instructions, suspending the corresponding one of the threads;and performing the garbage collection after each of the threads is suspended.
  8. 47
    An apparatus comprising:a processor having a settable state accessible to plural execution threads thereon and having an instruction set that includes an exception triggering operation encodable in an operation position of an instruction encoding for parallel execution of component operations;media accessible by the processor for encoding mutator code that includes an instance of the instruction encoding with an instance of the exception triggering operation encoded therein, the exception triggering operation instance referencing the settable state;and a handler responsive to execution of the exception triggering operation instance when the settable state encodes the exception triggering value.