IP Library Granted Patent US 10,353,749
Granted Patent B2
US 10,353,749 · App. 15/269,637 · Granted Jul 16, 2019

Lock-free dual queue with condition synchronization and time-outs

Inventor: William E. Hopkins (Brighton, CO)
Assignee: Level 3 Communications, LLC
G06F9/528G06F1/12G06F9/52G06F9/524G06F9/526G06F12/023G06F2212/1044
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,353,749
App. No.
15/269,637
Granted
Jul 16, 2019
Kind
B2
Abstract

Systems and methods for operating software data structures are provided. In one embodiment, lock-free dual queues with conditional synchronization and time-outs are described. The lock-free dual queues of various embodiments of the present invention are accessible by one or more consumer threads and one or more producing threads. The consuming threads are able to access and remove elements from the queue while the producing threads are able to access and add elements to the queue. In some cases, a thread may be both a consuming thread and a producing thread. The add and remove operations of various embodiments of the present invention, generally operate by using conditional synchronization primitives which modifies a value in shared memory to a specified value if the previous value is what was expected.

Claims (23)

1. A lock-free method of adding elements to a queue accessible by one or more producer threads and one or more consumer threads, the method comprising:

accessing a tail pointer indicating a last node;

reading a value from a next field of the last node indicated by the tail pointer, the next field initialized to zero and referring to a logically subsequent node;

determining whether the value from the next field of the last node has been modified by determining whether the value is zero;

when the value from the next field of the last node has not been modified, updating the next field of the last node to point to a new node;

allocating memory to represent the new node;

storing data from one of the one or more producer threads on the new node;

accessing a head pointer indicating a first node;

determining an abstract state of the queue, wherein the abstract state of the queue is an empty state, a data state, or a request state, wherein determining if the abstract state of the queue is the request state is based upon a positive indication in a request field of the node pointed to by the head pointer; and

when the determined abstract state of the queue is the request state:

determining a consumer thread of the one or more consumer threads that is associated with a first request to accept elements added to the queue by reading a requestor identification associated with a first request node;

setting a request value field of the first request node to refer to a node containing an added element value using a conditional synchronization primitive, wherein the request value field has been initialized to an unasserted value;

obtaining a mutex and condition variable of the consumer thread determined to be associated with the first request;

locking the mutex, signaling the condition variable, and unlocking the mutex to awaken the consumer thread that an element is ready for processing; and

determining if the consumer thread timed out by determining if the conditional synchronization primitive failed and a value in the request value field was set to an unasserted value.

2. The method of claim 1 , wherein the conditional synchronization primitive is a compare and swap instruction.

3. The method of claim 1 , further comprising determining whether signaling the condition variable is required in response to a failure of a test and set synchronization primitive on the done field of the request node.

4. The method of claim 1 , further comprising:

receiving a requested operation;

when the determined abstract state of the queue is the data state and the requested operation is an add operation, or when the determined abstract state of the queue is the request state and the requested operation is a remove operation:

determining if the tail pointer is not pointing to the last node by using the value of the next field of the node indicated by the tail pointer; and

using a conditional synchronization primitive to change the tail pointer to the value of the next field value of the node indicated currently by the tail pointer; and

restarting the operation by reading new values of the shared head and tail pointers.

Assignments (4)
ASSIGNMENT OF FIRST LIEN SECURITY INTEREST IN PATENT COLLATERAL RECORDED AT R/F 069295/0858 Recorded Jun 12, 2026
From: WILMINGTON TRUST, NATIONAL ASSOCIATION, AS RETIRING COLLATERAL AGENT
To: U.S. BANK TRUST COMPANY, NATIONAL ASSOCIATION, AS SUCCESSOR COLLATERAL AGENT
Reel/Frame 075738/0427 →
NOTICE OF GRANT OF SECURITY INTEREST IN INTELLECTUAL PROPERTY (SECOND LIEN) Recorded Nov 4, 2024
From: LEVEL 3 COMMUNICATIONS, LLC; GLOBAL CROSSING TELECOMMUNICATIONS, INC
To: WILMINGTON TRUST, NATIONAL ASSOCIATION, AS COLLATERAL AGENT
Reel/Frame 069295/0749 →
NOTICE OF GRANT OF SECURITY INTEREST IN INTELLECTUAL PROPERTY (FIRST LIEN) Recorded Nov 4, 2024
From: LEVEL 3 COMMUNICATIONS, LLC; GLOBAL CROSSING TELECOMMUNICATIONS, INC.
To: WILMINGTON TRUST, NATIONAL ASSOCIATION, AS COLLATERAL AGENT
Reel/Frame 069295/0858 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 20, 2016
From: HOPKINS, WILLIAM E.
To: LEVEL 3 COMMUNICATIONS, LLC
Reel/Frame 039802/0136 →
Continuity (4)
Division 11618814 · Dec 30, 2006
Continuation In Part 11323442 · Dec 30, 2005
Provisional Application 60832165 · Jul 20, 2006
Related Publication 20170010925A1 · Jan 12, 2017