NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Matching file to a physical medium



Hello,

On Fri, Oct 15, 2010 at 12:33:01AM +0100, Sad Clouds wrote:
> Well, one of the problems I'm trying to solve is what to do in a
> multi-threaded process, when threads access files and block forever,
> because some file are on NFS and the network goes down.
> 
> Ideally I would like a thread to issue a system call, time it for a
> number of microseconds and if there is no progress, abort the system
> call.
> 
> I'm struggling to find a good way to do it, because simply calling
> pthread_cancel() does not work. I'm not aware of any facility in Unix
> to abort a system call, maybe Unix signals can help, but I'd rather not
> mix signals and threads.

what about using select(2), kqueue(2) or poll(2) with a corresponding
timeout?

--
Matthias


Home | Main Index | Thread Index | Old Index