29.什么是异步编程?
void B() {
lines = read(filename);
sum(lines);
}
void A() {
...
B();
...
}void A() {
...
B();
something_important();
...
}Last updated
void B() {
lines = read(filename);
sum(lines);
}
void A() {
...
B();
...
}void A() {
...
B();
something_important();
...
}Last updated
void handle_file() {
lines = read(filename);
sum(lines);
}
void B() {
thread t(handle_file);
}
void A() {
...
B();
something_important();
...
}