There are test-and-set instructions for example :
68000 has "tas", SPARC has "ldstub" etc.
Upon return the value is set to the address. The return value varies - if the value really changes or not.
Keep in mind that application for the common desktop could safely assume one CPU but Intel's hyper threading technology break that founding.
Global variables are no option at all as I see it. If a common counter is needed (to indicate a change) a counting semaphore can be used.
Regards,
Iftach
This e-mail message has been sent by
Elbit Systems Ltd.
and is for the use of the intended
recipients only.
The message may contain privileged or commercial confidential information .
If you are not the intended recipient you are hereby notified that any use,
distribution or copying of this communication is strictly prohibited,
and you are requested to delete the e-mail and any attachments
The message may contain privileged or commercial confidential information .
If you are not the intended recipient you are hereby notified that any use,
distribution or copying of this communication is strictly prohibited,
and you are requested to delete the e-mail and any attachments
and notify the sender
immediately.
