The best way to understand how event notification works, is to use a mail delivery analogy. Think of yourself as your program. If you use a thread to wait for events (mpiNotifyEventWait), you are waiting
for the mail carrier (Event Manager). If you are polling for events (mpiNotifyEventWait), you check the mail periodically.
When the firmware sends an event, it is like a friend (MPI Object) sending you (Thread) a letter (ex: Event -- Motion Done). The letter (Event) travels to the post office (Controller Event Pool) where
your mail carrier (Event Manager) retrieves it and then delivers it to your mailbox (Notify Object).
Thread Waiting for Events 线程中等待事件
As soon as the mail carrier (Event Manager) shows up, the thread in your program checks the mailbox (Notify Object). 邮递员(event manager)一出现,你的程序中的线程就立即查看邮箱(notify 对象)。
Thread Polling for Events 线程中轮询事件
The thread in the program periodically checks the mailbox (Notify Object) to see if there is a letter (Event).线程定期的查看邮箱(notify 对象)来看是否有信(event)。
Thread using mpiNotifyEventWait 线程中使用mpiNotifyEventWait
If the thread in the program does not check the mailbox (Notify object), it will start to fill up with letters. The mail carrier (Event Manager) keeps stuffing more letters into the mailbox and figures that you will eventually check it. If the thread calls
an mpiNotifyEventWait(...), it checks the mailbox. But, it can only check one letter at a time。如果程序中的线程不检查邮箱(notify对象),邮箱会填满邮件。邮递员(event manager)持续往邮箱加信,他以为你最终会查看邮箱的。如果线程调用了 mpiNotifyEventWait(...),它会检查邮箱。但是一次只看一封信。
Thread using mpiNotifyEventFlush 线程中使用mpiNotifyEventFlush
If the thread in the program does not check the mailbox (Notify object), it will start to fill up with letters. The mail carrier (Event Manager) keeps stuffing more letters into the mailbox and figures that you will eventually empty it. If the thread calls
mpiNotifyEventFlush(...), mail carrier empties the mailbox and throws all the letters in the trash.如果程序中的线程没有检查邮箱(notify对象),邮箱会逐渐的变满。邮递员(event manager)持续的网邮箱里加邮件,他认为你最终会清空它。如果线程调用mpiNotifyEventFlush(...),邮递员会清空邮箱,并把所有的信扔进垃圾箱。