What is an artist pattern in a C ++ context?

Asio's author, Christopher Kochhoff, is working on a library and proposal for C ++ artists. His work so far includes these repo and docs . Unfortunately, part of the rationale has not yet been written. So far, the documents give some examples of what the library does, but I don’t feel like I'm missing something. Somehow this is more than the invoker family of fantastic features.

Everything I can find on Google is very specific to Java, and many of them relate to specific frameworks, so it’s hard for me to understand what an “artist template” is.

What are performers in this context? What are they doing? What are the canonical examples of when they would be useful? What are the options among performers? What are the alternatives to the performers and how are they compared? In particular, it seems that there are many overlaps with the event loop, where the events are the initial input events, execution events, and the shutdown event.

When trying to figure out new abstractions, I usually find an understanding of the key to motivation. So, for the performers, what are we trying to distract and why? What are we trying to make generic? Without performers, what additional work would we have to do?

+4
source share
2 answers

, 3 .

0

. Java- , , , , , . , , , , , ' , , .. , , , .

, , , . , , "" ( ) (, ). , , , .

executor , ( executor), executor . , - ( ) . , , , . , , , ; () , . ( / , ) .

( submit , result - ). std::async , ( // , , / , , , , ). executor , std::async , .

0

Source: https://habr.com/ru/post/1669463/


All Articles