task chains

This commit is contained in:
David Rose 2008-09-25 20:42:46 +00:00
parent bf86abd1c5
commit 7cd09665ac

View File

@ -41,6 +41,7 @@ Loader::
Loader(const string &name, int num_threads) : Loader(const string &name, int num_threads) :
AsyncTaskManager(name) AsyncTaskManager(name)
{ {
PT(AsyncTaskChain) chain = make_task_chain("");
if (num_threads < 0) { if (num_threads < 0) {
// -1 means the default number of threads. // -1 means the default number of threads.
@ -55,9 +56,9 @@ Loader(const string &name, int num_threads) :
"you have many CPU's available, to allow loading multiple models " "you have many CPU's available, to allow loading multiple models "
"simultaneously.")); "simultaneously."));
set_num_threads(loader_num_threads); chain->set_num_threads(loader_num_threads);
} else { } else {
set_num_threads(num_threads); chain->set_num_threads(num_threads);
} }
} }
@ -86,8 +87,9 @@ void Loader::
output(ostream &out) const { output(ostream &out) const {
out << get_type() << " " << get_name(); out << get_type() << " " << get_name();
if (!_threads.empty()) { int num_tasks = get_num_tasks();
out << " (" << get_num_tasks() << " models pending)"; if (num_tasks != 0) {
out << " (" << num_tasks << " models pending)";
} }
} }