mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
documentation: Sharpen up the no-readers quick quiz
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
This commit is contained in:
parent
6146f8df48
commit
5413e24c94
1 changed files with 8 additions and 5 deletions
|
@ -1002,18 +1002,21 @@ obligation to wait for these new readers.
|
||||||
<tr><th> </th></tr>
|
<tr><th> </th></tr>
|
||||||
<tr><th align="left">Quick Quiz:</th></tr>
|
<tr><th align="left">Quick Quiz:</th></tr>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
Suppose that synchronize_rcu() did wait until all readers had completed.
|
Suppose that synchronize_rcu() did wait until <i>all</i>
|
||||||
Would the updater be able to rely on this?
|
readers had completed instead of waiting only on
|
||||||
|
pre-existing readers.
|
||||||
|
For how long would the updater be able to rely on there
|
||||||
|
being no readers?
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><th align="left">Answer:</th></tr>
|
<tr><th align="left">Answer:</th></tr>
|
||||||
<tr><td bgcolor="#ffffff"><font color="ffffff">
|
<tr><td bgcolor="#ffffff"><font color="ffffff">
|
||||||
No.
|
For no time at all.
|
||||||
Even if <tt>synchronize_rcu()</tt> were to wait until
|
Even if <tt>synchronize_rcu()</tt> were to wait until
|
||||||
all readers had completed, a new reader might start immediately after
|
all readers had completed, a new reader might start immediately after
|
||||||
<tt>synchronize_rcu()</tt> completed.
|
<tt>synchronize_rcu()</tt> completed.
|
||||||
Therefore, the code following
|
Therefore, the code following
|
||||||
<tt>synchronize_rcu()</tt> cannot rely on there being no readers
|
<tt>synchronize_rcu()</tt> can <i>never</i> rely on there being
|
||||||
in any case.
|
no readers.
|
||||||
</font></td></tr>
|
</font></td></tr>
|
||||||
<tr><td> </td></tr>
|
<tr><td> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in a new issue