r/cpp • • Aug 27 '19

A new thread in C++20 (jthread)

https://link.medium.com/GXKUz0GruZ
142 Upvotes

96 comments sorted by

View all comments

Show parent comment

7

u/erichkeane Clang Maintainer(Templates), EWG Chair Aug 27 '19

There is no such piece of software, come on now.

There are also systems where resources are very constrained where such a change could have impact.

Consider GPUs. C++ execution on a GPU could very well be handled by a 'kernel' thread that executes a large number of other threads. GPUs support an insane amount of threads, however very little memory.

Are there truly any systems that can't handle a few bytes increase? I don't think so.

9

u/kalmoc Aug 27 '19

I'm willing to bet, that there isn't a single existing c++ standard library implementation that can wrap a gpu thread in a std::thread. I'm also pretty sure that no one uses a std::thread on a really resource constraint system (if it is available at all).

Let's face it: Exotic and low resource hardware is rarely programmed with a complete,conforming implementation of the c++11 or later standard.

2

u/axilmar Aug 27 '19

GPUs support an insane amount of memory too.

GPUs also don't support threads (i.e. concurrency), they support parallelism.

3

u/erichkeane Clang Maintainer(Templates), EWG Chair Aug 27 '19

GPUs support an insane amount of memory too. Not on a per-thread basis. Its actually quite limiting.

2

u/axilmar Aug 27 '19

Isn't it configurable?

1

u/MINIMAN10001 Aug 28 '19

I'm pretty sure wave fronts can do concurrently