C++ Logo


Advanced search

Re: [std-proposals] High Performance Thread-Safe C++

From: David G. Pickett <dgpickett_at_[hidden]>
Date: Fri, 23 Feb 2024 17:21:28 +0000 (UTC)
It'd be nice if the language had a way to say that a particular container *instance* needs to be thread safe, so all methods are mutex protected. The developer could add a reserved word in the declaration. This way, users are not accidentally using a mutex unnecessarily. The compiler can add the mutex lock to all methods when invoked, somewhat like a MACRO but less global. We don't want to be like Java, and have to remember which container name is synchronized, e.g ArrayList, Vector; StringBuffer, StringBuilder, or hve duffers using a synchronized container when not needed.

Received on 2024-02-23 17:21:35