discussion forum
message
| Name: |
Oliver |
| eMail: |
Follow.Me@gmx.net |
| Date: |
June 15, 2003 at 08:47:23 |
| Subject: |
Re: Hyperthreading and 'lock' prefix |
| In Reply To: |
Hyperthreading and 'lock' prefix by Stephan Keil on June 10, 2003 at 02:30:56 |
| Text: |
| Hi, | the x86 instruction set supports the 'lock' prefix for various | instructions (e.g. inc, add) to guarantee atomicity in multiprocessor | environments, i.e. multiple _physical_ processors. But is this | prefix also necessary for hyperthreading processors, i.e. two | logical processors within one physical processor? I've developed a simple Win32-program that finds out this when it runs on a HT-enabled uniprocessor-machine: http://520032173347-0001.bei.t-online.de/HtLock.cpp The program starts two threads which keep modifying a single DWORD with an unlocked cmpxchg. One threads increments the lower 16 bits of this DWORD while the other increments the upper 16 bits. If one thread sees that his 16-bit-part is different from what it set previously to this value, the unlocked cmpxchg isn't HT-safe. |
post a followup message
(Be nice... or be blocked. Be technical... or be erased.)
currently posted followup messages
(You may have to press the RELOAD button of your browser.)
|