The software is not failing, it is experiencing performance degradation: a 500ms pause whenever excessive and entirely unnecessary work is done.
The solution is to not do the work. Moving open/close to a different thread is premature optimization, as no necessary call has been profiled to cause issues on any known system.
Performance 101, do not do things that you do not need done. Even if you want live hotplug and input reconfiguration during gameplay without touching any menus, you only open a device when it appears.
> It is unsafe to make fair-weather assumptions about customer systems.
It is more pointless to optimize for worst-case scenarios - experiencing performance degradation on a faulty system is fine.
All applications have a minimum performance requirement to remain responsive, which is equivalent to always making a certain degree of "fair-weather assumptions".
> Consider a common software failure: where the user is saving data to a SMB or NFS partition, and then there is a loss of connectivity to that file-server, and the developer has done whatever I/O they need on the main thread. This causes data loss.
This is non-sequitur - doing something on the main thread does not cause data-loss. Losing connectivity causes data-loss.
Heck, as main-thread I/O with an event loop implies non-blocking fds, you would not even be blocked by this unless you call fsync(2) to explicitly block until flush is complete, which a normal application does not need to do. The other (horrible) side-effects of network filesystems will cause problems for your application no matter how you interact with the fd.
Furthermore, you cannot use device files without reasoning about their exact implementation. They are not basic files.
> Respecting those constraints, it is good practice to isolate sync calls to a non-main thread in order to catch when they are not returning.
That's a hack, and is not even a solution. What are you going to do when they don't return? Accumulate dead threads and inconsistent shared application state?