📄 mpiu_object_add_ref.tex
字号:
\startmanpage\mantitle{MPIU{\tt \char`\_}Object{\tt \char`\_}add{\tt \char`\_}ref}{tex}{10/7/2002}\manname{MPIU{\tt \char`\_}Object{\tt \char`\_}add{\tt \char`\_}ref}--- Increment the reference count for an MPI object \subhead{Synopsis}\startvb\begin{verbatim}void MPIU_Object_add_ref( MPIU_Object_head *ptr )\end{verbatim}\endvb\subhead{Input Parameter}\startarg{ptr }{Pointer to the object.}\par\subhead{Notes}In an unthreaded implementation, this function will usually be implementedas a single-statement macro. In an {\tt MPI{\tt \char`\_}THREAD{\tt \char`\_}MULTIPLE} implementation,this routine must implement an atomic increment operation, using, forexample, a lock on datatypes or special assembly code such as\begin{verbatim} try-again: load-link refcount-address to r2 add 1 to r2 store-conditional r2 to refcount-address if failed branch to try-again:\end{verbatim}on RISC architectures or\begin{verbatim} lock inc refcount-address or\end{verbatim}on IA32; "lock" is a special opcode prefix that forces atomicity. Thisis not a separate instruction; however, the GNU assembler expects opcodeprefixes on a separate line.\par\subhead{Module}MPID{\tt \char`\_}CORE\par\subhead{Question}This accesses the {\tt ref{\tt \char`\_}count} member of all MPID objects. Currently,that member is typed as {\tt volatile int}. However, for a purely polling,thread-funnelled application, the {\tt volatile} is unnecessary. ShouldMPID objects use a {\tt typedef} for the {\tt ref{\tt \char`\_}count} that can be definedas {\tt volatile} only when needed? For now, the answer is no; there isn'tenough to be gained in that case.\endmanpage
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -