Email List: Xaustin-group-lX
[All Lists]

RE: XSH/XRAT conflict over cancellation points

To: "Alexander Terekhov" <yyyyyyyy@xxxxxxxxxx>
Subject: RE: XSH/XRAT conflict over cancellation points
From: "Jason Zions" <yyyyyyyy@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 23 May 2004 21:21:05 -0700
Cc: "Wojtek Lerch" <yyyyyy@xxxxxxx>, <yyyyyyyyyyyyyy@xxxxxxxxxxxxx>
Thread-index: AcRAFkMnKdFdiIwaT1mnex1GDWMKGQA3CTeAABRnXHA=
Thread-topic: XSH/XRAT conflict over cancellation points
At the point at which your program invokes pthread_exit(), object o is
still in scope and thus its destructor has not yet been invoked.
Correct? (Up until pthread_exit() is invoked, we're still living in C++
land, but I'm pretty sure of my statement here.)

Since POSIX does not address C++, the definition of exit() (upon which
pthread_exit() is defined) does not speak to which destructors, if any,
are invoked before or after the rundown steps which the standard
requires at this point. The exit() function is defined as flushing all
open output streams, and closing them (among other things). If, in any
given implementation, the destructor is not invoked until after the open
stream underlying cout is closed, then you'll see no output.

If object o were created on the stack via "o = new object();" and an
atexit() handler were established which invoked "delete o;", then I
would fully expect to see Hello World appear on stdout. The exit() API
is defined to call atexit() handlers before flushing and closing stdout.

Don't ask vendors to bend their implementations to make your broken
program behave the way *you* want it to behave; the standards don't
guarantee the behavior you seek, and thus you are not entitled to rely
upon such behavior.

Don't like the quality of the implementation in Services For Unix 3.5?
Don't buy it. (Oh, wait, it's free. Don't download it, then.) Or, better
yet, take a look at the source code for the g++ compiler and runtime
which are available on the SFU 3.5 CD or for download from
ftp.microsoft.com and make them do whatever you want. >>Or submit a
defect report to the vendor through the normal channels and ask for a
fix, or wait for the next release of the product.<<

I'm going to say this one last time, Alexander. POSIX does not address
interactions with C++. The standard is SILENT on these issues, and thus
they cannot be used to make distinctions with respect to conformance.
This issue (and any other regarding the interaction of POSIX APIs with
C++ language mechanisms) is out of scope for this mailing list and
standards committee. Stop bringing it up.


-----Original Message-----
From: Alexander Terekhov [mailto:yyyyyyyy@xxxxxxxxxx]
Sent: Saturday, May 22, 2004 9:02 AM
To: Jason Zions
Cc: Wojtek Lerch; yyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: RE: XSH/XRAT conflict over cancellation points

> Please?

Please make this program print hello world under MS UNIX/Windows.
Please.

----
Welcome to the Interix UNIX utilities.

DISPLAY=localhost:0.0
% pwd
/dev/fs/C/Documents and Settings/Alexander % cat zions.cpp #include
<iostream> #include <pthread.h>

int main() {
  struct object { ~object() { std::cout << "hello world.\n"; } } o;
  pthread_exit(0);
}

%
----

regards,
alexander.

<Prev in Thread] Current Thread [Next in Thread>