C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Helper class to make safe a thread-unsafe class

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Thu, 29 Jun 2023 08:33:32 +0200
Il 29/06/23 02:32, Breno GuimarĂ£es via Std-Proposals ha scritto:
> There is merit in being able to choose the mutex though.
>
> There are mutexes with deadlock detection instrumentation. Others have
> specialized optimizations for certain workloads.
> Others would expose shared/unique locking interfaces.
>
> I say this because I work in an application that makes use of all those
> types.
>
> It also allows for recursive_mutex, and we do use it, but we are not
> proud of it :)

For some reason, synchronized_value in Boost allows the choice of the
mutex type, but the one in the Concurrency TS doesn't. Does anyone know
the reason?

Boost:
   template<typename T, typename Lockable = mutex>
   class synchronized_value;

Concurrency:
   template<class T>
   class synchronized_value;

Thanks,
-- 
Giuseppe D'Angelo

Received on 2023-06-29 06:33:38