Re: What would it take....
Samuel Thibault <[email protected]> Wed, 23 Dec 2009 10:29:19 +0100
| Newsgroups | gmane.os.hurd.l4,gmane.os.hurd.general,gmane.os.hurd.bugs |
|---|---|
| Message-ID | <[email protected]> |
Samuel Thibault, le Wed 23 Dec 2009 10:26:09 +0100, a écrit : > Da Zheng, le Wed 23 Dec 2009 16:46:34 +0800, a écrit : > > > If you use volatile, the compiler won't > > > optimise instructions so it would "work" too ; note however that it's > > > not SMP safe (it may even not be premption-safe, depending on which > > > instruction the compiler eventually uses). > > We don't need both? If there is only volatile, instructions might be executed out of order and compilers might also reorder instructions. > > Volatile prevents from compiler reorder. Oops, sorry, of course not. You need the memory clobber for that. Or use a function call and not assume that ordering will be correct for local variables. Samuel