Date: Wed, 31 May 2023 19:48:08 -0700
On Wednesday, 31 May 2023 19:44:10 PDT Phil Bouchard wrote:
> > In other words, we need a std::lock_guard or equivalent. How is this
> > different from a regular mutex? This is a very simple example and yet
> > we've already got ourselves a mutex and needing to think about which
> > operations need to be protected so the state doesn't change from under
> > us.
>
> This example shows what I had in mind:
> https://github.com/philippeb8/std__ts/blob/master/ts.cpp
You didn't address my point, that this simple solution required a mutex and
reasoning what the critical section span should be. How is this any different,
let alone safer, from what we already have?
> > In other words, we need a std::lock_guard or equivalent. How is this
> > different from a regular mutex? This is a very simple example and yet
> > we've already got ourselves a mutex and needing to think about which
> > operations need to be protected so the state doesn't change from under
> > us.
>
> This example shows what I had in mind:
> https://github.com/philippeb8/std__ts/blob/master/ts.cpp
You didn't address my point, that this simple solution required a mutex and
reasoning what the critical section span should be. How is this any different,
let alone safer, from what we already have?
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Software Architect - Intel DCAI Cloud Engineering
Received on 2023-06-01 02:48:11