Methods for single-owner multi-consumer work queues for repeatable tasks
First Claim
Patent Images
1. A method, comprising:
- permitting a single owner thread of a single owner, multi-consumer, work queue to access the work queue using atomic instructions limited to only a single access and using non-atomic operations;
restricting the single owner thread from accessing the work queue using atomic instructions involving more than one access; and
synchronizing amongst other threads with respect to their respective accesses to the work queue,wherein operations performed by the single owner thread comprise an insertion operation that involves atomically reading at least two integer values from a single shared variable having at least two integer components respectively relating to a head of the work queue and a number of items in the work queue into a first and a second local variable respectively, writing an item into a work queue entry having an index based on a sum of the first and the second local variables, and atomically writing at least two values to the single shared variable, the at least two values respectively comprising the first local variable and a sum of the second local variable plus one.
1 Assignment
0 Petitions
Accused Products
Abstract
There are provided methods for single-owner multi-consumer work queues for repeatable tasks. A method includes permitting a single owner thread of a single owner, multi-consumer, work queue to access the work queue using atomic instructions limited to only a single access and using non-atomic operations. The method further includes restricting the single owner thread from accessing the work queue using atomic instructions involving more than one access. The method also includes synchronizing amongst other threads with respect to their respective accesses to the work queue.
16 Citations
18 Claims
-
1. A method, comprising:
-
permitting a single owner thread of a single owner, multi-consumer, work queue to access the work queue using atomic instructions limited to only a single access and using non-atomic operations; restricting the single owner thread from accessing the work queue using atomic instructions involving more than one access; and synchronizing amongst other threads with respect to their respective accesses to the work queue, wherein operations performed by the single owner thread comprise an insertion operation that involves atomically reading at least two integer values from a single shared variable having at least two integer components respectively relating to a head of the work queue and a number of items in the work queue into a first and a second local variable respectively, writing an item into a work queue entry having an index based on a sum of the first and the second local variables, and atomically writing at least two values to the single shared variable, the at least two values respectively comprising the first local variable and a sum of the second local variable plus one. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A method, comprising:
-
permitting a single owner thread of a single owner, multi-consumer, work queue to access the work queue using atomic instructions limited to only a single access and using non-atomic operations; restricting the single owner thread from accessing the work queue using atomic instructions involving more than one access; and synchronizing amongst other threads with respect to their respective accesses to the work queue, wherein operations performed by the single owner thread comprise an extraction operation that involves atomically reading at least two integer values from a single shared variable having at least two integer components respectively relating to a head of the work queue and a number of items in the work queue into a first and a second local variable respectively, reading a work queue entry having an index based on a sum of the first local variable and the second local variable minus one, and atomically writing at least two values to the single shared variable, and returning the work queue entry, the at least two values respectively comprising the first local variable and the second local variable minus one.
-
-
10. A program storage device readable by machine, tangibly embodying a program of instructions executable by the machine to perform method steps for queue access management, the method steps comprising:
-
permitting a single owner thread of a single owner, multi-consumer, work queue to access the work queue using atomic instructions limited to only a single access and using non-atomic operations; restricting the single owner thread from accessing the work queue using atomic instructions involving more than one access; and synchronizing amongst other threads with respect to their respective accesses to the work queue, wherein operations performed by the single owner thread comprise an insertion operation that involves atomically reading at least two integer values from a single shared variable having at least two integer components respectively relating to a head of the work queue and a number of items in the work queue into a first and a second local variable respectively, writing an item into a work queue entry having an index based on a sum of the first and the second local variables, and atomically writing at least two values to the single shared variable, the at least two values respectively comprising the first local variable and a sum of the second local variable plus one. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
Specification