Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Asm для Linux/Unix > чтение-модификация-запись на многоядерном проце


Автор: rukudias 19.6.2012, 17:42
Привет Всем!
Собственно вопрос:
-как будет выполняться команда (чтение-модификация-запись) асм на много ядерном процессоре.
те атомарна ли она?

Автор: LosAngelеs 16.9.2012, 00:00
атомарна с префиксом lock, выдержка из амд мануала:
Цитата

The LOCK prefix causes certain kinds of memory read-modify-write instructions to occur atomically.
The mechanism for doing so is implementation-dependent (for example, the mechanism may involve
bus signaling or packet messaging between the processor and a memory controller). The prefix is
intended to give the processor exclusive use of shared memory in a multiprocessor system.

The LOCK prefix can only be used with forms of the following instructions that write a memory
operand: ADC, ADD, AND, BTC, BTR, BTS, CMPXCHG, CMPXCHG8B, CMPXCHG16B, DEC,
INC, NEG, NOT, OR, SBB, SUB, XADD, XCHG, and XOR
. An invalid-opcode exception occurs if
the LOCK prefix is used with any other instruction.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)