[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: program hangs in exit()



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dan Kegel wrote:

> The standard says returning from main is the same as calling exit,
> exit says it closes all files, but read doesn't say the I/O will
> be interrupted if some other thread closes the file while the read is
> blocked.

The standard doesn't say anything about the situation where exit() is
called and there are other threads running except that in the end all
threads are gone.  This means the behavior of the threads which are
still running isn't guaranteed in any way anymore.  This situation has
to be avoided by the programmer if any negative effect is possible.

The I/O locking is one example.  The it is fine for the implementation
to assume locking isn't in effect anymore.  Therefore the LT behavior
was just fine.  One can argue that the current NPTL behavior is fine as
well and that it is a programmer's mistake to let it come to this.   And
in fact, it might be the safer option.

But we added to LT behavior back when because it became apparent that
most programmers don't pay attention to the shutdown process and hanging
processes are bad.


David Arnold <arnold dstc monash edu au>:

> see point two of Dave's answer to this Usenet query (i knew i'd seen
> this before

That's something completely different.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+1W662ijCOnn/RHQRAv9yAJ9Xut6eEvy3BMX+vjHovYwpLpuhmwCbBwgm
umf/KZrAngscmE/ymTE56Jo=
=EUFq
-----END PGP SIGNATURE-----




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]