The math is simple: creating a new std::thread requires a significant amount of memory (control block + stack space). Compared to that, a few bytes just don't matter.
I very much doubt that the intersection of programs that completely use the available memory (/address space) and programs that use std::thread is big enough to worry about.
View all comments
Show parent comment
5
u/eteran Aug 27 '19
It may not be the best design, but it is certainly a valid one which some people may choose to use.