摘要 |
<p>PURPOSE:To synchronize two pieces of CPU for the shortest time by setting a memory space to a common memory and judging that respective pieces of CPU are synchronized when a value of the first and second words for synchronization which are read from a common memory two times is not accordant respectively. CONSTITUTION:CPU1 reads a word A for synchronization from a common memory 3 and waits for a constant time. During the time, CPU2 rewrtites a synchronizing program A. Next, a synchronizing word B is incremented by ''+1'', and the word A for synchronization is read from the common memory 3. It is judged whether or not the word A for synchronization which is read earlier and the word A for synchronization which is read this time are the same, at the time of YES an action from the beginning is repeated and at the time of NO the word preceeds to a next main program. Namely, while the work A for synchronization is read again, the word A for synchronization is rewrited by CPU2, and then, it is presumed that a reading value of two times of the word A for synchronization is different, CPU2 also executes a synchronizing program and synchronization is completed.</p> |