[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Can't interrupt tight loops in Lua 5.4 anymore?
- From: Viacheslav Usov <via.usov@...>
- Date: Thu, 21 May 2020 20:11:07 +0200
On Thu, May 21, 2020 at 5:43 AM Soni "They/Them" L. <fakedme@gmail.com> wrote:
> the 68k can't be interrupted in the middle of an instruction, so on a
> pure 68k even long writes are atomic. however, once you add the z80, it
> *can* sneak in an access in the middle of a long write.
There is certainly a reason why atomics are in C11 and not in C89.
It is also not accidental that Z80 and i8088, ostensibly 16-bit
processors with an 8-bit memory bus, were a high point for Zilog, and
just the beginning for Intel. A relevant difference is that the latter
has a LOCK instruction prefix and a LOCK hardware pin.
In the platform that you mentioned, the main CPU can only do one byte
at a time when accessing the shared memory, and only having acquired
the memory bus of Z80, which stalls the latter - even while it is
trying to access the second half of a 16-bit value, oops.
So it is actually 68K that can "sneak in", which means there are no
"long writes" for either party there. And no atomicity in the shared
memory out of the box. Not that it would be difficult to put together
some atomic protocol.
Cheers,
V.
- References:
- Can't interrupt tight loops in Lua 5.4 anymore?, Joseph C. Sible
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Roberto Ierusalimschy
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Andrew Gierth
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Roberto Ierusalimschy
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Viacheslav Usov
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Roberto Ierusalimschy
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Viacheslav Usov
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Roberto Ierusalimschy
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Joseph C. Sible
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Roberto Ierusalimschy
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Joseph C. Sible
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Massimo Sala
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Joseph C. Sible
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Viacheslav Usov
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Joseph C. Sible
- Re: Can't interrupt tight loops in Lua 5.4 anymore?, Soni "They/Them" L.