CPC G06F 9/526 (2013.01) [G06F 9/5005 (2013.01); G06F 13/1663 (2013.01); G06F 13/28 (2013.01)] | 23 Claims |
1. A method comprising:
implementing a request ring in a portion of shared virtual memory (SVM) on a computing platform including a multi-core processor and one or more SVM-capable accelerators, the multi-core processor including a bus to which a plurality of processor cores are coupled;
receiving a plurality of requests to access the request ring from a plurality of worker threads concurrently executing on cores of the multi-core processor cores;
for a request that is received from a worker thread,
assigning, via a lockless arbiter without using software locks, an index of an available slot on the request ring and returning the index to the worker thread making the request;
implementing an atomic counter in a ring overflow guard;
in response to receiving requests from worker threads to access the request ring, for each request,
locking the bus,
incrementing the atomic counter;
unlocking the bus;
detecting, via the ring overflow guard, whether the request ring is full by determining whether a value of the atomic counter is greater than a threshold; and
when the value of the atomic counter is greater than the threshold,
locking the bus;
decrementing the atomic counter;
unlocking the bus; and
returning indicia to the worker thread that the request ring is full;
otherwise, when the value of the atomic counter is not greater than the threshold, returning an index of an available slot to the worker thread.
|