1 year ago
#340961
Enlico
What are the execution contexts in P2300R4?
I'm referring to P2300R4, which is long and difficult, given my current level, but I want to understand more about it.
It refers to execution contexts since the beginning
§ 1. Introduction
This paper proposes a self-contained design for a Standard C++ framework for managing asynchronous execution on generic execution contexts. […]
and keeps referring to these contexts throughout the paper, but I haven't really understood what they are.
The following excerpt is supposed to explain what an execution context is, at least based on the first few words:
§ 4.1. Execution contexts describe the place of execution
An execution context is a resource that represents the place where execution will happen. This could be a concrete resource - like a specific thread pool object, or a GPU - or a more abstract one, like the current thread of execution. Execution contexts don’t need to have a representation in code; they are simply a term describing certain properties of execution of a function.
But I really don't understand.
To give some more context about what level I'm at, I could understand without much difficulties the three examples in the § 1.3 Examples: End User section, probably only thanks to the bit of Haskell I know, but then I had to fly over § 1.4-1.6 (I'll probably try to read § 1.4.1.3 Echo server which I might understand if I make some more effort); I could understand § 1.7.1 Composability with execution::let_*
and probably also the following section.
However, I also have to clarify that I when I write I understand I mostly mean that I can read the code snippets and tell what they do, but I don't necessarily have a preception of how they work, e.g. I mostly understand what is the role of | ex::let_error(some_fun)
(and similar bits) in a pipeline, but I wouldn't be able to guess how ex::let_error
could be implemented to have that effect.
c++
asynchronous
language-lawyer
executioncontext
c++23
0 Answers
Your Answer