aboutsummaryrefslogtreecommitdiffstats
path: root/doc/guides/prog_guide/ring_lib.rst
diff options
context:
space:
mode:
authorRicardo Salveti <ricardo.salveti@linaro.org>2016-07-18 15:30:53 -0300
committerRicardo Salveti <ricardo.salveti@linaro.org>2016-07-18 15:31:22 -0300
commit5d4e5dcd8a186778b3d78e27c81550d07a288fd2 (patch)
treeb84800fce31e7233445a7997c19df409c2a364ea /doc/guides/prog_guide/ring_lib.rst
parenta41e6ff15809d40e0f9bbc9576bf8f7f80fbec1d (diff)
Imported Upstream version 16.07-rc3
Change-Id: I321148bfa234858ba1986d109470b7aa280cd429 Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Diffstat (limited to 'doc/guides/prog_guide/ring_lib.rst')
-rw-r--r--doc/guides/prog_guide/ring_lib.rst30
1 files changed, 15 insertions, 15 deletions
diff --git a/doc/guides/prog_guide/ring_lib.rst b/doc/guides/prog_guide/ring_lib.rst
index 3b92a8f0..9f697538 100644
--- a/doc/guides/prog_guide/ring_lib.rst
+++ b/doc/guides/prog_guide/ring_lib.rst
@@ -252,8 +252,8 @@ In this example, only the producer head and tail (prod_head and prod_tail) are m
The initial state is to have a prod_head and prod_tail pointing at the same location.
-Multiple Consumer Enqueue First Step
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Multiple Producers Enqueue First Step
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
On both cores, *ring->prod_head* and ring->cons_tail are copied in local variables.
The prod_next local variable points to the next element of the table,
@@ -266,11 +266,11 @@ If there is not enough room in the ring (this is detected by checking cons_tail)
.. figure:: img/ring-mp-enqueue1.*
- Multiple consumer enqueue first step
+ Multiple producer enqueue first step
-Multiple Consumer Enqueue Second Step
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Multiple Producers Enqueue Second Step
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The second step is to modify ring->prod_head in the ring structure to point to the same location as prod_next.
This operation is done using a Compare And Swap (CAS) instruction, which does the following operations atomically:
@@ -288,11 +288,11 @@ In the figure, the operation succeeded on core 1, and step one restarted on core
.. figure:: img/ring-mp-enqueue2.*
- Multiple consumer enqueue second step
+ Multiple producer enqueue second step
-Multiple Consumer Enqueue Third Step
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Multiple Producers Enqueue Third Step
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The CAS operation is retried on core 2 with success.
@@ -303,11 +303,11 @@ The core 1 updates one element of the ring(obj4), and the core 2 updates another
.. figure:: img/ring-mp-enqueue3.*
- Multiple consumer enqueue third step
+ Multiple producer enqueue third step
-Multiple Consumer Enqueue Fourth Step
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Multiple Producers Enqueue Fourth Step
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Each core now wants to update ring->prod_tail.
A core can only update it if ring->prod_tail is equal to the prod_head local variable.
@@ -318,11 +318,11 @@ This is only true on core 1. The operation is finished on core 1.
.. figure:: img/ring-mp-enqueue4.*
- Multiple consumer enqueue fourth step
+ Multiple producer enqueue fourth step
-Multiple Consumer Enqueue Last Step
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Multiple Producers Enqueue Last Step
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Once ring->prod_tail is updated by core 1, core 2 is allowed to update it too.
The operation is also finished on core 2.
@@ -332,7 +332,7 @@ The operation is also finished on core 2.
.. figure:: img/ring-mp-enqueue5.*
- Multiple consumer enqueue last step
+ Multiple producer enqueue last step
Modulo 32-bit Indexes