[Haskell-cafe] fcntl locks, executeFile and threaded runtime

Brandon Allbery allbery.b at gmail.com
Sat Oct 26 15:58:07 UTC 2013


On Sat, Oct 26, 2013 at 11:38 AM, Donn Cave <donn at avvanta.com> wrote:

> Question about the syscall trace -- in the second, threaded version,
>
> > [pid 11612] fcntl(7, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0,
> len=0}) = 0
> ...
> > [pid 11612] +++ exited with 0 +++
>
> ?? In the not threaded version, I don't see the child process exit - and
> wasn't expecting to, since it's supposed to have exec'd to /usr/bin/sleep.
>

You don't see it in the non-threaded one because the parent throws an
exception while setting the lock and exits first. The sleep is only 5
seconds, so the second one reaches waitForProcess and collects it (note
that the "parent: fail!" is a putStrLn, not an error) before exiting.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131026/a02153fb/attachment.html>


More information about the Haskell-Cafe mailing list