Re: can linux RT thread corrupt global variable?
Thorsten Holtkaemper <[email protected]> Tue, 6 May 2003 14:03:36 +0200
| Newsgroups | gmane.linux.ngpt.user |
|---|---|
| Message-ID | <[email protected]> |
On Tuesday 06 May 2003 02:39, Ming Lei wrote:
> There is a global variable I define as 'int cpl'. All the threads and main
> process may alter cpl at any time. cpl may have one of these values {0,
> 0xf000006e, 0xf0000068, 0xe0000000, 0xe0000060}.
I'm not really sure if this is right, but if I understand correctly you access
this global variable without locking, assuming that the access to an integer
is an atomic operation. Depending on the platform and the implementation this
might not be true and lead to the experienced effect.
But again - may be I'm plain wrong ...
Regards,
Thorsten