Pourquoi avons-nous besoin d'utiliser boost :: asio :: io_service :: work?

Il est un exemple de l'utilisation de boost::asio.

  1. Pourquoi cet exemple utiliser le boost::asio::io_service::le travail ?
  2. Et pourquoi est - srv.run (); pas appelé à effectuer des tâches dans les filets?
int main()
{
    boost::asio::io_service srv;
    boost::asio::io_service::work work(srv);
    boost::thread_group thr_grp;
    thr_grp.create_thread(boost::bind(&boost::asio::io_service::run, &srv));
    thr_grp.create_thread(boost::bind(&boost::asio::io_service::run, &srv));

    srv.post(boost::bind(f1, 123));
    srv.post(boost::bind(f1, 321));
    //sync

    srv.post(boost::bind(f2, 456));
    srv.post(boost::bind(f2, 654));
    //sync

    srv.stop();
    thr_grp.join();
}

Mise à jour:
Quelle est la différence entre le sondage et courir, quand io_service est utilisé sans io_service::le travail?

int main()
{
    boost::asio::io_service srv;
    //boost::asio::io_service::work work(srv);
    std::vector<boost::thread> thr_grp;

    srv.post(boost::bind(f1, 123));
    srv.post(boost::bind(f1, 321));
    //sync

    srv.post(boost::bind(f2, 456));
    srv.post(boost::bind(f2, 654));
    //sync

    //What is the difference between the poll and run, when io_service without work?
    thr_grp.emplace_back(boost::bind(&boost::asio::io_service::poll, &srv));//poll or run?
    thr_grp.emplace_back(boost::bind(&boost::asio::io_service::run, &srv));//poll or run? 

    srv.stop();
    for(auto &i : thr_grp) i.join();

    int b;
    std::cin >> b;

    return 0;
}

source d'informationauteur Alex