×

Using data in elements of a singly linked list without a lock in a multithreaded environment

  • US 8,141,086 B2
  • Filed: 06/06/2008
  • Issued: 03/20/2012
  • Est. Priority Date: 06/06/2008
  • Status: Expired due to Fees
First Claim
Patent Images

1. A computer-implemented method for validating a scan of an unused element chain in a multithreaded computing environment, said method comprising:

  • executing, by a computing system, a first thread and a second thread in said multithreaded computing environment;

    atomically copying, by a computing system, using said first thread, and from a header of said unused element chain (chain), a modification counter into a first variable and an anchor address into a second variable, wherein said atomically copying includes initially setting a browse counter in said first variable to said modification counter, and wherein said chain is a singly linked list data structure;

    setting, by said computing system, using said first thread and subsequent to said atomically copying, said second variable to a next address stored in a current element of said chain, wherein said next address references a next element of said chain, wherein said current element is initially a first element of said chain, and wherein said first element is referenced by said anchor address;

    incrementing, by said computing system, using said first thread and subsequent to said atomically copying, said browse counter stored in said first variable to indicate an advance of said scan;

    determining, by said computing system and subsequent to said setting and said incrementing, that said browse counter is greater than a current value of said modification counter, wherein said current value of said modification counter indicates any modification made to said chain by said second thread;

    determining, by said computing system and in response to said determining that said browse counter is greater than said current value of said modification counter, that said scan of said chain is valid up to said current element of said chain;

    concluding, by said computing system, said scan of said chain; and

    storing, by said computing system and in response to said concluding said scan, an indication of a result of said scan, wherein said indication of said result is selected from the group consisting of an indication that said scan is valid and an indication that said next address is an invalid address, and wherein said storing said indication of said result includes storing said indication of said result in a first computer data storage unit coupled to said computing system or in a second computer data storage unit coupled to another computing system.

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