[gclist] synchronization cost (was: Garbage collection and XML)
Ji-Yong D. Chung
Sat, 10 Mar 2001 16:55:16 -0500
I am embarassed to admit that, on my prev.
posting, I should have checked my facts before commenting
on spin locks and XCHG.
After seeing Boehm's email, I ran tests on XCHG,
and I am getting slightly worse results, at about
22 instruction cycles for each XCHG.
I have run the tests on Pentium II (200 MHZ),
WindowsNT4.0, SP4. The test is compiled using VC++6.
The test has to be run multiple times either
with a VC++6.0 profiler or with a timer,
and with minimum no of processes on the
|| Here is my code for running the test
struct _timeb begin, end;
int locker = 0;
int* lock_addr = &locker;
mov ebx, [lock_addr]
mov ecx, 10000000
mov edx, ebx
mov eax, 1
xchg eax, [edx] // Here is the XCHG
cout << (end.time - begin.time) * 1000 + end.millitm - begin.millitm <<