Hirdetés

Új hozzászólás Aktív témák

  • P.H.

    senior tag

    válasz #95904256 #1458 üzenetére

    Mi történik? Felhasználói program esetén jól a programozó körmére néznek, :) hogy miért csinált ilyen jellegű kódot (hacsak nem kifejezetten HyperThreading-szerű felépítésre és osztott L1 D-cache-re írta a programot), már csak a felesleges adatvándorlások miatt is. Vagy hogy legalább miért nincsenek a közös adatot módosító részek levédve legalább pl. OS-szintű critical section-ben.

    Kernel-szinten elkerülhetetlenek az ilyen események (pl. pont a critical section-okat kezelő mutex-ek, vagy egyéb semaphorok, event-ek esetében), akkor a hardware megoldja, ahogy tudja.


    Pl. AMD esetében:
    ''Deadlocks can occur when multiple processors fight for the ownership of the same cache-line. They do so for instance if they both want to write to the same line. A cache-line is generally loaded as soon as possible in case of a cache-miss. This will cause the cache-line to be invalidated in other caches in case of a store. Two processors get in a deadlock if they keep invalidating each others cache-lines before they are able to finish the stores.

    An example given is the case where two processor try to complete a store which is to an unaligned address so that part of the store data goes to cache line A1 and part of the store data goes to cache line A2. Unaligned stores of this type are typically split into two stores by the hardware. An exponential back-off mechanism is provided to handle this kind of deadlock situations. A back-off time is introduced when the memory access remains unsuccessful before retrying to become owner of the cache-line again. This time grows exponentially after each unsuccessful try until one of the processors finally succeeds.
    ''

    [Szerkesztve]

    Arguing on the Internet is like running in the Special Olympics. Even if you win, you are still ... ˙˙˙ Real Eyes Realize Real Lies ˙˙˙

Új hozzászólás Aktív témák