discussion forum



message

Name: Oliver
eMail: Follow.Me@gmx.net
Date: June 17, 2003 at 06:00:12
Subject: Re: Hyperthreading and 'lock' prefix
In Reply To: Re: Hyperthreading and 'lock' prefix by
Stephan Keil on June 16, 2003 at 06:41:05
Text: > Have you tried your program on a HT system?

I've posted the following to some newsgroups:

|| Subject: Can anyone run this on a HT-enabled system ?
|| From: "Oliver S."
|| Newsgroups: comp.programming.threads,comp.arch,comp.sys.intel
||
|| I've developed a little Win32 test-app that verifies if on a HT-enabled
|| P4-processor (or more precisely - on current HT-enabled P4-processors) the
|| CMPXCHG-instruction is atomic without a lock-prefix. My work is related to
|| a question in the discussion-forum on sandpile (http://www.sandpile.org
|| /post/msgs/20003998.htm):
||
|| | 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?
||
|| As I don't own a HT-capable P4-processor, I'm looking for someone who
|| will try this on his HT-enabled machine. So please download my test-app
|| (including the soure) from http://520032173347-0001.bei.t-online.de
|| /HtLock.zip and report your experience with this test here.
||
|| PS: I don't know if the app will run correctly on HT-enabled systems with
|| multiple physical CPUs (I don't know if SetThreadAffinity will assign
|| the two threads to the same physical processor in this case) only re-
|| sults from systems with a single physical CPU are useful.

And some minutes ago, I got the first reply in the NGs:

> Just the fact: I tried it on HT system (P4 2.8Ghz, Family 15, Model
> 2, Stepping 7) and it showed that unlocked instruction is not HT-safe
> (adding lock prefix to cmpxchg fixed thread safety).




post a followup message
(Be nice... or be blocked. Be technical... or be erased.)

Name: optional link title:
eMail: optional link URL:
Subject: optional image URL:
  Insert line breaks by hand when only about one inch remains at the right side. Otherwise your message will be unreadable.
Text:
 

  Note: The above eMail form fields may look unaligned if you are using a browser other than Netscape Navigator version 3.0.



currently posted followup messages
(You may have to press the RELOAD button of your browser.)




main page