toolsoftrade: Consistently add parentheses to function names
PATCH 1/5 toolsoftrade: Consistently add parentheses to function names
Parentheses are appended to all function names including 'mythread()', but one case is not. This commit adds parentheses there.
--- toolsoftrade/toolsoftrade.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
toolsoftrade/toolsoftrade.tex +1 -1
@@ -344,7 +344,7 @@ ID of the thread to be created, the second \co{NULL} argument is a pointer to an optional \co{pthread_attr_t}, the third argument is the function (in this case, \co{mythread()}) that is to be invoked by the new thread, and the last \co{NULL} argument -is the argument that will be passed to \co{mythread}. +is the argument that will be passed to \co{mythread()}. \end{fcvref} \begin{listing}
Signature · 1 line
2.17.1
PATCH 2/5 toolsoftrade: Add arguments in 'WRITE_ONCE()' example
A sentence explaining common things between 'READ_ONCE()' and '__atomic_load_n()' provides arguments, but the explanation for 'WRITE_ONCE()' doesn't. This commit makes it also consistently provides the arguments.
--- toolsoftrade/toolsoftrade.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
toolsoftrade/toolsoftrade.tex +1 -1
@@ -544,7 +544,7 @@ primitives. \cref{chp:Advanced Synchronization: Memory Ordering}. In the meantime, \co{READ_ONCE(x)} has much in common with the \GCC\ intrinsic \co{__atomic_load_n(&x, __ATOMIC_RELAXED)} - and \co{WRITE_ONCE()} has much in common with the \GCC\ + and \co{WRITE_ONCE(x, v)} has much in common with the \GCC\ intrinsic \co{__atomic_store_n(&x, v, __ATOMIC_RELAXED)}. }\QuickQuizEndE }
Signature · 1 line
2.17.1
PATCH 3/5 toolsoftrade: Consistently wrap 'volatile' with '\co{}'
In reply to SeongJae ParkA sentence is wrapping 'volatile' with '\co{}' for most cases but one case. This commit makes it consistently wrap the keyword with the macro.
--- toolsoftrade/toolsoftrade.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
toolsoftrade/toolsoftrade.tex +1 -1
@@ -803,7 +803,7 @@ rights to assume that the value of \co{goflag} would never change. most of the accesses are protected by a lock (and thus \emph{not} subject to change), but where a few of the accesses are made outside of the lock. - Using a volatile declaration in this case would make it harder + Using a \co{volatile} declaration in this case would make it harder for the reader to note the special accesses outside of the lock, and would also make it harder for the compiler to generate good code under the lock.
Signature · 1 line
2.17.1
PATCH 4/5 toolsoftrade: Fix a typo
In reply to SeongJae Park--- toolsoftrade/toolsoftrade.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
toolsoftrade/toolsoftrade.tex +1 -1
@@ -851,7 +851,7 @@ rights to assume that the value of \co{goflag} would never change. This leads to the question of how one thread can gain access to another thread's \apig{__thread} variable, and the answer is that the second thread must store a pointer to its \apig{__thread} - pointer somewhere that the first thread has access to. + variable somewhere that the first thread has access to. One common approach is to maintain a linked list with one element per thread, and to store the address of each thread's \apig{__thread} variable in the corresponding element.
Signature · 1 line
2.17.1
PATCH 5/5 toolsoftrade: Use '\co{}' instead of '{\tt}'
In reply to SeongJae ParkThere is a sentence using '{\tt}' instead of '\co{}'. This commit updates those.
--- toolsoftrade/toolsoftrade.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
toolsoftrade/toolsoftrade.tex +5 -5
@@ -1448,10 +1448,10 @@ spin_unlock(&mutex); \end{VerbatimU} \QuickQuiz{ - What problems could occur if the variable {\tt counter} were - incremented without the protection of {\tt mutex}? + What problems could occur if the variable \co{counter} were + incremented without the protection of \co{mutex}? }\QuickQuizAnswer{ - On CPUs with load-store architectures, incrementing {\tt counter} + On CPUs with load-store architectures, incrementing \co{counter} might compile into something like the following: \begin{VerbatimU}
@@ -1461,9 +1461,9 @@ STORE r0,counter \end{VerbatimU} On such machines, two threads might simultaneously load the - value of {\tt counter}, each increment it, and each store the + value of \co{counter}, each increment it, and each store the result. - The new value of {\tt counter} will then only be one greater + The new value of \co{counter} will then only be one greater than before, despite two threads each incrementing it. }\QuickQuizEnd
Signature · 1 line
2.17.1
Paul E. McKenney
AppliedQuoted 4 lines · SeongJae Park
Parentheses are appended to all function names including '
mythread()', but one case is not. This commit adds parentheses there.Signed-off-by SeongJae Park <[email protected]>
Queued and pushed the series, thank you!
Thanx, Paul
Quoted 20 lines
--- toolsoftrade/toolsoftrade.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)toolsoftrade/toolsoftrade.tex +1
-1@@ -344,7 +344,7 @@ ID of the thread to be created, the second \co{NULL} argument is a pointer to an optional \co{pthread_attr_t}, the third argument is the function (in this case, \co{mythread()}) that is to be invoked by the new thread, and the last \co{NULL} argument -is the argument that will be passed to \co{mythread}. +is the argument that will be passed to \co{mythread()}. \end{fcvref} \begin{listing}Signature · 1 line
2.17.1