I use the Linux function mount(2)
in a single-threaded process. But installing devices, such as a CD-ROM, may take some time (the worst I've seen is 40 seconds!), Since it takes a moment to think about it, part the disk, and only then mount the file system. This can block the process from processing other events for a considerable time.
I cannot find a way to mount the file system in a non-blocking way. Is there a way to mount a file system asynchronously without multithreading or forking?
Knowing whether the action is actually complete is not a problem for me, since I already read the uevents core in the same thread.
source
share