Различия между x86/x64/ia64 моделями памяти на.NET

Попробуйте

    SELECT w1.users_id AS user1,u.name as name, p.*, u.*, w2.users_id 
    AS user2, COUNT(w2.watched) AS num_movies, 
    GROUP_CONCAT(w2.watched ORDER BY w2.watched) AS movies 
    FROM watched w1 
    JOIN watched w2 ON w2.watched = w1.watched 
    AND w2.users_id != w1.users_id 
    JOIN users u ON u.id=w1.users_id 
    JOIN profile p ON p.users_id=w1.users_id 
    WHERE w1.users_id =1 GROUP BY user1, user2

ВЫХОД enter image description here

5
задан Jonathan Rupp 20 April 2009 в 12:37
поделиться

3 ответа

Two articles on the .NET memory model (which is stronger than the ECMA model, btw):

Joe Duffy's book, Concurrent Programming on Windows, is also a great source of information on this topic.

5
ответ дан 14 December 2019 в 19:25
поделиться

Это может быть слишком низкий уровень для вас, но некоторые старше 64-битные процессоры AMD не имеют CMPXCHG16B (Source) if you were relying on that as a hardware non-blocking instruction.

Also there seem to be changes in the memory model for C++ which may be relevant so you may have to keep an eye out if you are doing very low level code.

The memory model 'specified' by the CLR is an ongoing topic of debate within Microsoft (discussed openly at least as far back as 2003). As a side note Chris Brumme states in that article that the model of x64 is the same as x86 which I would assume is an accurate statement for the purposes of CLR hosted code.

Unless your target users explicitly include Itanium I would think that simply including a fallback, slower but simple and safe, implementation for that architecture would be sufficient for correctness. There is then no need to indicate that your software is broken on that platform, just that it operates in a slower fallback mode. If people subsequently want to use the platform seriously you can code to that much looser model.

Note that the x64 JIT is different to the x86 JIT (significantly so since 3.5 SP1) so any Release Mode testing on one is not representative of the other and vice versa. Test as appropriate.

0
ответ дан 14 December 2019 в 19:25
поделиться

Модель памяти .NET указана в спецификации ECMA ISO / IEC-23271. В частности, в разделе I: Концепции и архитектура, глава 12.6 «Модель памяти и оптимизации».

Этот стандарт определяет границы, в которых может работать JIT. Если вы хотите быть нейтральным к архитектуре, вы должны следовать этому стандарту и не использовать какие-либо особенности JIT x86 / x64.

Кроме того, x64 - это эволюция x86, он состоит в основном из дополнительных инструкций, регистров и некоторых расширений (SSE2), определяемых как базовые для всех x64-совместимых процессоров. Модели памяти почти не изменились, за исключением дополнительного адресного пространства и дополнительных режимов адресации (указатель инструкций относительно доступа к данным). Поэтому оптимизация для JIT x86 должна также дать хорошие результаты на x64.

0
ответ дан 14 December 2019 в 19:25
поделиться
Другие вопросы по тегам:

Похожие вопросы: