4 ms·
> When performance really matters, you have to start thinking at the hardware level. Formula One driver Jackie Stewart is famous for once saying, “You don’t hav
by kasey_junk 11y ago
> When performance really matters, you have to start thinking at the hardware level. Formula One driver Jackie Stewart is famous for once saying, “You don’t have to be an engineer to be be a racing driver, but you do have to have mechanical sympathy.”
If you are going to reference that quote, talk about ring buffers, and false sharing. I think it behooves you to credit Martin Thompson or LMAX in some way. That is a near verbatim quote from the Disruptor papers.
- jonathanoliver 11y agoThat was the same thought I had when I read through the ring buffer section. One glaring problem in the Golang space is the memory model doesn't offer Happens-Before guarantees. I wrote a project called Go-Disruptor (github.com/smartystreets/go-disruptor) and found that I can't guarantee ordering of writes and reads between threads which is absolutely critical for a ring buffer implementation.
- jzelinskie 11y agoWould you mind expanding on this? I've never implemented a ring buffer and am genuinely curious.
- anon4 11y agoI haven't written Go, but from what I've heard it lets you mix in platform-specific assembly. Can't you use that to put in memory barriers and/or issue the specific load/store instructions you need?
- theparanoid 11y agoYou can, the Go runtime and standard library use assembly for a number of operations. A drawback is difficulty reading and reasoning about assembly. C style intrinsics are easier.
- deleted 11y ago[deleted]
- aleksi 11y ago> One glaring problem in the Golang space is the memory model doesn't offer Happens-Before guarantees. It does: https://golang.org/ref/mem#tmp_2 https://golang.org/ref/mem#tmp_2
- eternalban 11y ago> That was the same thought I had when I read through the ring buffer section. I am glad to see this being called out. I had the same precise 'wait a minute' response to that article.