×

Thread synchronization by transitioning threads to spin lock and sleep state

  • US 9,003,413 B1
  • Filed: 09/28/2009
  • Issued: 04/07/2015
  • Est. Priority Date: 09/28/2009
  • Status: Active Grant
First Claim
Patent Images

1. A method of synchronizing a main thread and a slave thread, comprising:

  • obtaining an initial work unit at the main thread;

    dividing the initial work unit into a first work unit and another work unit;

    sending, via a wake-up message, the first work unit from the main thread to the slave thread; and

    processing the other work unit at the main thread;

    transitioning the slave thread from a sleep state to a spin-lock state in response to the wake-up message from the main thread;

    transitioning the slave thread out of the spin-lock state to process the first work unit from the main thread;

    determining, at the main thread that executes on a processor, an elapsed time period until receipt of a second work unit for the slave thread, wherein the act of determining the elapsed time period is performed before the receipt of the second work unit;

    transitioning the slave thread to the spin-lock state if the elapsed time period satisfies a threshold time period; and

    transitioning the slave thread to the sleep state if the elapsed time period does not satisfy the threshold time period.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×