[–] bsaul 4y ago ↗ I’m confused by the infinite « while » : is it a common pattern of lock-free data structures ? [–] codefreakxff 4y ago ↗ Do you mean this part“This is a busy-wait loop, which makes for a simple illustration but isn’t ideal. In a real program I’d have the producer run a job while it waits for a queue slot, or just have it turn into a consumer (if this wasn’t a single-consumer queue)”
[–] codefreakxff 4y ago ↗ Do you mean this part“This is a busy-wait loop, which makes for a simple illustration but isn’t ideal. In a real program I’d have the producer run a job while it waits for a queue slot, or just have it turn into a consumer (if this wasn’t a single-consumer queue)”
[–] Randor 4y ago ↗ "If for some reason a capacity of 32,767 is insufficient, you can trivially upgrade your queue to an Enterprise Queue"Thanks for the laugh! :)
3 comments
[ 3.1 ms ] story [ 19.0 ms ] thread“This is a busy-wait loop, which makes for a simple illustration but isn’t ideal. In a real program I’d have the producer run a job while it waits for a queue slot, or just have it turn into a consumer (if this wasn’t a single-consumer queue)”
Thanks for the laugh! :)