摘要 |
A system for facilitating thread-safe message passing communications among threads in respective processes includes arrangements for coordinating collective communication operations, as between collective and non-collective communication operations, and as among threads in a process receiving messages contemporaneously. For collective communication operations, a master thread is provided and each process is provided with a slave thread. When a user thread in a process is to engage in a collective operation, it notifies its process's slave thread, which notifies the master process. When the master process has received notifications the slave threads of all of the processes which have user threads that are to engage in the collective operation, it notifies the slave threads that the collective operation is to proceed. As between collective and non-collective operations, the user threads that are to engage in a non-collective operation goes through a locking sequence in which it acquires two locks before transmitting a message, whereas for collective operations the second lock is acquired before the operation is performed. In coordinating message reception, each thread in a process iteratively performs a locked message probe operation in which it initially acquires a message probe lock that regulates the locked message probe operation as among threads in the process, and thereafter determines whether a message is available for the respective thread. The message receive control module, if the message probe control module determines that a message is available for the respective thread, receives the message.
|