📄 mpid_comm_thread_lock.tex
字号:
\startmanpage\mantitle{MPID{\tt \char`\_}Comm{\tt \char`\_}thread{\tt \char`\_}lock}{tex}{10/7/2002}\manname{MPID{\tt \char`\_}Comm{\tt \char`\_}thread{\tt \char`\_}lock}--- Acquire a thread lock for a communicator \subhead{Synopsis}\startvb\begin{verbatim}void MPID_Comm_thread_lock( MPID_Comm *comm )\end{verbatim}\endvb\subhead{Input Parameter}\startarg{comm }{Communicator to lock}\par\subhead{Notes}This routine acquires a lock among threads in the same MPI process thatmay use this communicator. In all MPI thread modes except for{\tt MPI{\tt \char`\_}THREAD{\tt \char`\_}MULTIPLE}, this can be a no-op. In an MPI implementationthat does not provide {\tt MPI{\tt \char`\_}THREAD{\tt \char`\_}MULTIPLE}, this may be a macro.\parIt is invalid for a thread that has acquired the lock to attempt toacquire it again. The lock must be released by {\tt MPID{\tt \char`\_}Comm{\tt \char`\_}thread{\tt \char`\_}unlock}.\parNote that there is also a common per-process lock ({\tt common{\tt \char`\_}lock}).That lock should be used instead of a lock on lock on {\tt MPI{\tt \char`\_}COMM{\tt \char`\_}WORLD} whena lock across all threads is required.\parA high-quality implementation may wish to provide fair access to the lock.\parIn general, the MPICH implementation tries to avoid using locks becausethey can cause problems such as livelock and deadlock, particularly whenan error occurs. However, the semantics of MPI collective routines makeit difficult to avoid using locks. Further, good programming practice byMPI programmers should be to avoid having multiple threads using thesame communicator.\par\subhead{Module}Communicator\par\subhead{See Also}{\tt MPID{\tt \char`\_}Comm{\tt \char`\_}thread{\tt \char`\_}unlock}\par\subhead{Questions}Do we also need versions of this for datatypes and window objects?For example, communicators, datatypes, and window objects all haveattributes; do we need a thread lock for each type? Should we instead havean MPI Object, on which some common operations, such as thread lock,reference count, and name are implemented?\endmanpage
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -