×

Method and system for robust futexes

  • US 7,783,649 B2
  • Filed: 02/01/2007
  • Issued: 08/24/2010
  • Est. Priority Date: 02/01/2007
  • Status: Active Grant
First Claim
Patent Images

1. A method of managing futex primitives, the method comprising:

  • Providing a private data structure in user-space, the private data structure being private to a first computer process and comprising at least one futex, wherein each futex serves as a lock on a resource provided by a computer system;

    Registering the private data structure by the first computer process;

    Linking a pending entry data structure to the private data structure;

    Setting a pending entry flag in the pending entry data structure, wherein the pending entry flag indicates that the first computer process is about to acquire a selected futex;

    Acquiring the selected futex from a plurality of futexes;

    Linking the selected futex to the private data structure after acquiring the selected futex;

    Detecting a termination of the first computer process;

    Searching the private data structure and the pending entry data structure for a status of the selected futex, wherein at least one other computer process is waiting for the selected futex;

    Setting a first flag for the selected futex indicating that the first computer process terminated prior to releasing the selected futex if the status indicates that the selected futex is held by the first computer process or if the pending entry flag is set;

    Releasing the selected futex if the first flag is set for the selected futex; and

    Notifying the at least one other computer process, and if the first flag is set for the selected futex, the at least one other computer process resolves race conditions and verifies a consistency of data associated with the resource locked by the selected futex.

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