Download tools/mosesdecoder/moses/TranslationModel/UG/test-boost-threadpool.cc from Quagmire1/wiki-cased: direct link, hf CLI and curl.
- Browser
- Download file 642 Bytes
-
https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/moses/TranslationModel/UG/test-boost-threadpool.cc
- Command line
-
hf download hf://Quagmire1/wiki-cased/tools/mosesdecoder/moses/TranslationModel/UG/test-boost-threadpool.cc
-
curl -L -o test-boost-threadpool.cc https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/moses/TranslationModel/UG/test-boost-threadpool.cc
642 Bytes
| using namespace std; | |
| class hello | |
| { | |
| size_t n; | |
| public: | |
| hello(size_t const x) : n(x) { } | |
| void operator()() { cout << "hello #" << n << endl; } | |
| }; | |
| int main() | |
| { | |
| ug::ThreadPool T(10); | |
| vector<boost::shared_ptr<hello> > jobs; | |
| for (size_t i = 0; i < 20; ++i) | |
| { | |
| boost::shared_ptr<hello> j(new hello(i)); | |
| jobs.push_back(j); | |
| T.add(*j); | |
| } | |
| } | |