And no, creating threads to solve this fringe problem in a spin loop with a sleep is not what I'd call "smart". It's unnecessary complexity and in most cases, totally wasted work.
And no, creating threads to solve this fringe problem in a spin loop with a sleep is not what I'd call "smart". It's unnecessary complexity and in most cases, totally wasted work.
This is a very bad reason to justify something. Especially introduce threads. Your response here is like saying "I don't know why people say it's so hard to write multi threaded programs, the thread create API is so simple." It completely misses the point why added complexity can be harmful.
> without rarely occurring bugs.
Except for a glaring thing like "what if fflush gets an I/O error in this background thread"?
> Granted, it would rub me the wrong way if libc did this by default,
This is exactly my point. It needs cooperation from the application layer. It wouldn't make sense to be transparent.
Complexity, readability, etc. is the argument people make when they've run out of arguments.