Операций | a+b(ms) | (a+b) in procedure (ms) | intelock(a+b)in procedure (ms) | Разница |
200 000 | 3 | 4 | 6 | 133% |
1 000 000 | 16 | 23 | 34 | 144% |
2 000 000 | 33 | 46 | 69 | 139% |
InterlockedExchange в виде функции:
Procedure InterlockedExchange(*Destination.Integer, Value.i)
!mov ecx, [p.p_Destination]
!mov eax, [p.v_Value]
!lock xchg [ecx], eax
ProcedureReturn
EndProcedure