Patent ID: 7543295

Claim:
A method for causing an information processing apparatus to execute an exclusion control between a plurality of tasks, wherein the information processing apparatus includes a memory device which has a first memory area for storing first information indicating that a first task acquires or attempts to acquire a right to exclude, and a second memory area for storing second information indicating about which one of a plurality of second tasks acquires or attempts to acquire the right to exclude, and in which a time lag may occur between a time when the first task issues a writing instruction and a time when a written content is enabled to be referred to by the second task, and the method comprises the steps of: reading the second memory area after issuance of the writing instruction to write the first information to the first memory area in response to a request for the first task to acquire the right to exclude; making a reply indicating a success of the right to exclude acquisition on condition that the second information is not read; erasing the first information from the first memory area, and making a reply indicating a failure of the right to exclude acquisition on condition that the second information is read; erasing the first information from the first memory area in response to the request for the first task to release the right to exclude; executing an atomic operation instruction to write the second information specifying the second task to the second memory area if the second information is not stored in the second memory area, in response to the request for the second task to acquire the right to exclude; writing the second information to the second memory area, which enables the written content to be referred to by the first task, on occasion that the writing of the second information due to the atomic operation instruction succeeds, and thereafter executing a write-reflection process for enabling the content written in the first memory area by the first task to be referred to by the second task; which reads the first memory area after completion of the write-reflection process; reading the first memory area after completion of the write-reflection process; making the reply indicating the success of the right to exclude acquisition on condition that the first information is not read from the first memory area; erasing the second information from the second memory area, and making the reply indicating the failure of the right to exclude acquisition on condition that the first information is read; and making the reply indicating the failure of the right to exclude acquisition on condition that the writing of the second information due to the atomic operation instruction is failed; and erasing the second information from the second memory area in response to the request for the second task to release the right to exclude.