A thread pool would surely be better (for something like this, anyway, in
which the full complement will only be needed in extreme situations).
There are several thread pools in the kernel (pdflush) or out-of-tree
patches (fs-cache's slow-work threads) already. It's quite doable.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds