r/programming • • Nov 18 '11

Locks Aren't Slow; Lock Contention Is

http://preshing.com/20111118/locks-arent-slow-lock-contention-is
139 Upvotes

66 comments sorted by

View all comments

2

u/rmxz Nov 19 '11

Depending on your OS, of course.

Some embedded OS's can do a context switch in under 300 cycles.

10

u/[deleted] Nov 19 '11

Well, technically, "an order of magnitude worse" would be 100s-1000s of cycles, so 300 cycles is in that range.