mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-15 23:35:42 -04:00
Start separate thread for inode ordering
This makes it easier to tell apart in `htop` and similar tools.
This commit is contained in:
parent
411468872e
commit
9320f502f4
@ -661,8 +661,13 @@ void scanner_<LoggerPolicy>::scan(
|
||||
LOG_INFO << "building blocks...";
|
||||
block_manager bm(lgr_, prog, cfg_, os_, fsw);
|
||||
|
||||
{
|
||||
worker_group blockify("blockify", 1, 1 << 20);
|
||||
|
||||
{
|
||||
worker_group ordering("ordering", 1);
|
||||
|
||||
ordering.add_job([&] {
|
||||
im.order_inodes(script_, options_.file_order,
|
||||
[&](std::shared_ptr<inode> const& ino) {
|
||||
blockify.add_job([&] {
|
||||
@ -677,6 +682,10 @@ void scanner_<LoggerPolicy>::scan(
|
||||
return INT64_C(500) * queued_blocks +
|
||||
static_cast<int64_t>(queued_files);
|
||||
});
|
||||
});
|
||||
|
||||
ordering.wait();
|
||||
}
|
||||
|
||||
LOG_INFO << "waiting for segmenting/blockifying to finish...";
|
||||
|
||||
@ -684,6 +693,7 @@ void scanner_<LoggerPolicy>::scan(
|
||||
|
||||
LOG_INFO << "segmenting/blockifying CPU time: "
|
||||
<< time_with_unit(blockify.get_cpu_time());
|
||||
}
|
||||
|
||||
bm.finish_blocks();
|
||||
wg_.wait();
|
||||
|
Loading…
x
Reference in New Issue
Block a user