On 10/18/2026 8:43 PM, Stefan Monnier wrote:
Anton Ertl [2026-10-18 16:57:26] wrote:I believe this all started with empirical data from Anton showing different performance between Intel and AMD processors for XCHG reg,reg.
And actually all the stuff about XCHG with memory operands does notHow could code witness the difference?
contradict this sentence. It could be understood as meaning that
while all the other aspects of locking don't apply to "XCHG reg, reg",
the assertion of the LOCK# signal still has to occur, and that's why
Intel processors implement a slow XCHG reg, reg.
I believe AMD can claim that its behavior is consistent with the
behavior you'd get when asserting the LOCK# signal.
=== Stefan
Dan Cross [2026-10-20 02:00:48] wrote:
In article <jwv8q3uqrxf.fsf-monnier+comp.arch@gnu.org>,
Stefan Monnier <monnier@iro.umontreal.ca> wrote:
How could code witness the difference?The effects of a bus lock include disallowing memory operations
(except for instruction fetches or page table accesses) passing
a locked operation.
Ah, so it doesn't just make the operation atomic, but it additionally
imposes barrier-style restrictions on reordering surrounding memory >operations? I see, thanks.
cross@spitfire.i.gajendra.net (Dan Cross) writes:
In article <jwv8q3uqrxf.fsf-monnier+comp.arch@gnu.org>,
Stefan Monnier <monnier@iro.umontreal.ca> wrote:
Anton Ertl [2026-10-18 16:57:26] wrote:
And actually all the stuff about XCHG with memory operands does not
contradict this sentence. It could be understood as meaning that
while all the other aspects of locking don't apply to "XCHG reg, reg", >>>> the assertion of the LOCK# signal still has to occur, and that's why
Intel processors implement a slow XCHG reg, reg.
How could code witness the difference?
I believe AMD can claim that its behavior is consistent with the
behavior you'd get when asserting the LOCK# signal.
The effects of a bus lock include disallowing memory operations
(except for instruction fetches or page table accesses) passing
a locked operation. If `XCHG reg,reg` where indeed treated as
though it asserted `LOCK#` for the duration of its execution, it
could be (ab)used to force that behavior: From sec 11.1.2.2 of
SDM Volume 3a (Sept 2026 version):
It's worth noting that AMD processors (in the 2008 timeframe) would
assert the LOCK# signal if a highly contended cache line could not
be acquired in exclusive mode within a certain window of time,
even if the access was completely encapsulated in said cache line.
I suspect that is still the case.
Niklaus Wirth was possibly the biggest critic of the Algol 68 effort.
He and Tony Hoare had previously created Algol-W, which pioneered the
concept of record structures (taking a simpler form than COBOLrCOs
convoluted record structures). Pascal was basically the next step in
the evolution of that.
On Mon, 19 Oct 2026 01:46:21 -0000 (UTC), Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> wrote:
Niklaus Wirth was possibly the biggest critic of the Algol 68 effort.
He and Tony Hoare had previously created Algol-W, which pioneered the
concept of record structures (taking a simpler form than COBOLrCOs
convoluted record structures). Pascal was basically the next step in
the evolution of that.
And, of course, one might mention MODULA-2, which took certain
advanced ideas seen in Ada and put them in a Pascal-like context.
My understanding is that the influences went from Modula-2 to Ada, and >Wikipedia agrees with me, saying that Modula-2 first appeared in 1978.
On Wed, 21 Oct 2026 18:34:46 +0300, Niklas Holsti <niklas.holsti@tidorum.invalid> wrote:
My understanding is that the influences went from Modula-2 to Ada, and >>Wikipedia agrees with me, saying that Modula-2 first appeared in 1978.
You're quite right. I searched for more information, and apparently Concurrent Pascal was "first", with MODULA-2 coming very shortly
after. And then, after the two competing models of those languages
were discussed for a while, Ada included the feature as well.
However, one source claimed that PL/I should really be given the
credit for including parallel constructs well before Concurrent
Pascal.
Anton Ertl [2026-10-18 16:57:26] wrote:
And actually all the stuff about XCHG with memory operands does not
contradict this sentence. It could be understood as meaning that
while all the other aspects of locking don't apply to "XCHG reg, reg",
the assertion of the LOCK# signal still has to occur, and that's why
Intel processors implement a slow XCHG reg, reg.
How could code witness the difference?
Stefan Monnier <monnier@iro.umontreal.ca> writes:
Anton Ertl [2026-10-18 16:57:26] wrote:
And actually all the stuff about XCHG with memory operands does not
contradict this sentence. It could be understood as meaning that
while all the other aspects of locking don't apply to "XCHG reg,
reg", the assertion of the LOCK# signal still has to occur, and
that's why Intel processors implement a slow XCHG reg, reg.
How could code witness the difference?
Depends on the hardware. If there is some device connected t the
LOCK# signal (e.g., another CPU), and that behaves differently when
the signal is asserted, the code can measure that.
- anton
On Wed, 21 Oct 2026 18:34:46 +0300, Niklas Holsti <niklas.holsti@tidorum.invalid> wrote:
My understanding is that the influences went from Modula-2 to Ada, and
Wikipedia agrees with me, saying that Modula-2 first appeared in 1978.
You're quite right. I searched for more information, and apparently Concurrent Pascal was "first", with MODULA-2 coming very shortly
after. And then, after the two competing models of those languages
were discussed for a while, Ada included the feature as well.
However, one source claimed that PL/I should really be given the
credit for including parallel constructs well before Concurrent
Pascal.
On 10/21/2026 12:38 PM, John Savard wrote:
On Wed, 21 Oct 2026 18:34:46 +0300, Niklas Holsti
<niklas.holsti@tidorum.invalid> wrote:
My understanding is that the influences went from Modula-2 to Ada, and
Wikipedia agrees with me, saying that Modula-2 first appeared in 1978.
You're quite right. I searched for more information, and apparently
Concurrent Pascal was "first", with MODULA-2 coming very shortly
after. And then, after the two competing models of those languages
were discussed for a while, Ada included the feature as well.
However, one source claimed that PL/I should really be given the
credit for including parallel constructs well before Concurrent
Pascal.
I vaguely recall that there was an optional feature in the COBOL
standard for concurrent processing, or something like that. It wasn't >implemented in the compiler I used and I never investigated exactly what
it was. But it certainly predated Pascal, Ad and other such languages.
Does anyone else know anything about this?
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 54:48:36 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,582 |