> Date: Thu, 25 Apr 2013 19:36:28 +0100 > From: Tim Murphy <tnmur...@gmail.com> > Cc: "bug-make@gnu.org" <bug-make@gnu.org> > > 1) sem_timedwait() in posix lets you timeout so in a big build when > something crashes or just sits around, there is at least the option of > printing an error message or giving up on locking from that point on which > is a bit of a godsend if it happens overnight and there's no-one to restart > the build.
How much would you use for the timeout, though? A sub-Make could legitimately run for a very long time, depending on what's in the Makefile. FWIW, I currently let Make wait forever for the mutex. > With stdio and file locks I don't know if this is a problem > anyhow for crashes (are locks automatically released?) Yes, locks are automatically released once the file descriptor is closed (which happens on a crash or exit). > but the behaviour between windows and linux might be different. It is similar: when a process holding a mutex exits or crashes on Windows, the mutex is released. If another process was waiting for the mutex, it gets a special indication about such calamities (because in some cases of synchronization, that might mean the shared resource is in inconsistent state), but in our case, we don't care, at least the way I wrote the code in its current shape. _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make