⚛ <0xe2.0x9a.0...@gmail.com> writes:

> 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.
>
> Using std::future in the source code would mean that some parts of Mesa
> need to be converted from C to C++11.
>
> 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.

Yeah, IMO std::async is a minimally intrusive way to offload
computations to a separate thread which avoids many of the pitfalls of
managing concurrency and thread pools by hand.  For the moment I'm going
to stay away from the discussion of whether it's the right solution for
the GL front-end or not, but I think it would definitely make sense to
try out your idea in the CL state tracker, since it already uses C++11
extensively and currently doesn't take advantage of concurrency for
kernel compilation (even though the CL API was designed to allow
implementations to build CL kernels asynchronously).

> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to