ouch-org / ouch

Painless compression and decompression in the terminal
https://crates.io/crates/ouch
Other
2.25k stars 76 forks source link

Run logging IO in a separate thread (improve multithread capabilities) #643

Closed marcospb19 closed 7 months ago

marcospb19 commented 7 months ago

Bringing some discussion from #632 to this dedicated issue.

Problem

The way we currently handle STDIN and STDOUT can cause synchronization problems: #510 is a terrible bug.

The issue above is also a reason why we can't have progress bars back: #632.

Besides bugs and features, it also causes performance problems: #77, our worker threads block progress to do blocking IO.

Solution

@AntonHermann came up with a solution (sent in #632's discussion):

image

Basically, this enables us to solve all the previously listed issues!

Again, discussion and more details can be found at #632.