[Mesa-dev] Discussion: C++11 std::future in Mesa

Jason Ekstrand jason at jlekstrand.net
Fri May 27 20:11:01 UTC 2016


On Fri, May 27, 2016 at 11:49 AM, ⚛ <0xe2.0x9a.0x9b at gmail.com> wrote:

> Hello.
>
> http://en.cppreference.com/w/cpp/thread/future
> http://en.cppreference.com/w/cpp/thread/async
>
> Assumption: Shader compilation will need run on separate thread(s).
>
> From a certain perspective, one of the easy ways of removing Mesa shader
> compilation from the "main" thread would be to use std::future for some
> fields in struct gl_program (defined in mtypes.h) and in related source
> code.
>

Given that mtypes.h is included (and struct gl_program) is used by a *lot*
of C code, I think using any sort of C++ there is a non-starter, 2011 or
otherwise.

As far as threading goes, we have other ways of dealing with threading than
introducing C++11.  Something that works with C is probably a better path
forward.


> Using std::future in the source code would mean that some parts of Mesa
> need to be converted from C to C++11.
>

The "some parts" you're talking about are almost all of mesa.  I don't
think that's going to happen.


> This post to mesa-dev is just to start the discussion and to determine how
> many devs are in favor of C++11 (and why) and how many are against C++11
> (and why) in Mesa.
>
> Looking forward to your opinions.
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160527/d162beec/attachment.html>


More information about the mesa-dev mailing list