You could set an alarm (see alarm() and setitimer() ) that times out after a few seconds.
You could set an alarm (see alarm() and setitimer()) that times out after a few seconds.
Well, I don't know how to make a faster check, but I may suggest you to check all mount points at the same time, in parallel, so you will always have the same total time, even with many samba mounts.
I'm answering my own question. The goal was to minimize the time spent by several processes trying to access stale mountpoints. Normally, the system calls would complete in subsecond time.
Blocking on stale shares for 10 sec, or even, say, 3 sec was not acceptable because these calls are done in several places, multiple times and the delay time accumulates. So, I ended up writing a monitoring process, which checks mounts every n seconds and unmounts them if they are inaccessible. I also read info from my configs saying which filesystems are supposed to be remote(mounted) and check mtab file - if they are not there, it's an error.
Code checking mtab completes in a subsecond time. Took a day or two to implement, but works fine for me.
The goal was to minimize the time spent by several processes trying to access stale mountpoints. Normally, the system calls would complete in subsecond time. Blocking on stale shares for 10 sec, or even, say, 3 sec was not acceptable because these calls are done in several places, multiple times and the delay time accumulates.
So, I ended up writing a monitoring process, which checks mounts every n seconds and unmounts them if they are inaccessible. I also read info from my configs saying which filesystems are supposed to be remote(mounted) and check mtab file - if they are not there, it's an error. Code checking mtab completes in a subsecond time.
Took a day or two to implement, but works fine for me.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.