[M3devel] atomics vs. locks..

Jay K jay.krell at cornell.edu
Sun Mar 14 19:30:59 CET 2010


http://msdn.microsoft.com/en-us/library/ee418650(VS.85).aspx


MemoryBarrier was measured as taking 20-90 cycles.

InterlockedIncrement was measured as taking 36-90 cycles.

Acquiring or releasing a critical section was measured as taking 40-100 cycles.

Acquiring or releasing a mutex was measured as taking about 750-2500 cycles

 

perhaps just use critical sections...

 

 

(I'm very ambivalent about atomics. It is just so darn difficult to do lockless programming.

Granted, if you are a systems language, then you need to be able to imlement the locks themselves.

 Perhaps.)


 - Jay
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100314/509e0a00/attachment-0001.html>


More information about the M3devel mailing list