7 ms·
Lock free structures are as slow as your memory allocation scheme (nota bene: I've designed several lockfree structures). If you're clever about how you use th
by shin_lao 13y ago
Lock free structures are as slow as your memory allocation scheme (nota bene: I've designed several lockfree structures).
If you're clever about how you use them, it can be a big win.
HLE isn't really HTM, but it's a first step.
- colanderman 13y agoLock free structures are as slow as your memory allocation scheme I've found they're an order of magnitude slower than your architecture's atomics, and mostly exacerbated by the memory fencing required. Though, the structures I've used (queue & stack) didn't require any memory allocation on the fly. HLE isn't really HTM, but it's a first step. I know; my post should be read in the broader context of Intel's TSX (which includes their RTM instructions).
- shin_lao 13y agoWhich lock-free structure have you been using and for what purpose?
- colanderman 13y agoMichael & Scott, "Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms", which I understand to be fairly standard, as well as the "textbook" lock-free stack algorithm (dunno who invented it, I re-"invented" it myself and then confirmed it was identical to that given in The Art of Multiprocessor Programming). Use case for the queue is message-passing. Use case for the stack is as the allocator for the queue.
- shin_lao 13y agoWhich language? C? You did your own implementation? Sounds like you used the wrong stuff.
- colanderman 13y agoYes, C, my own implementation. What is the "right" stuff for low-latency high-contention message passing?
- shin_lao 13y agoWell, if you were coding in C++ I would say "have a look at TBB". The thing is, text book implementations generally lack all the platform dependant details to make it efficient.