Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #85

Re: std::terminate per thread - std vs. MS practice?

Message-ID <in2vof$o76$1@dont-email.me> (permalink)
Newsgroups comp.lang.c++.moderated, comp.std.c++
From Daniel Krügler <daniel.kruegler@googlemail.com>
Subject Re: std::terminate per thread - std vs. MS practice?
Organization A noiseless patient Spider
References <in2jpe$cvg$1@dont-email.me>
Date 2011-04-01 07:52 -0600

Cross-posted to 2 groups.

Show all headers | View raw


Am 01.04.2011 00:33, schrieb Martin B.:
>
> Hi!
>
> Since C++ never talked about threads, MS was quite free to specify[1]:
>
> set_terminate (CRT)
> -------------------
> (Visual Studio 2010 )
>
> Installs your own termination routine
> to be called by terminate.
> ...
>
> In a multithreaded environment, terminate
> functions are maintained separately for each
> thread. Each new thread needs to install its
> own terminate function. Thus, each thread is
> in charge of its own termination handling.
>
> Now, looking at the latest std draft (N3242):
> 18.8.3.1 Type terminate_handler
>
> 2 Required behavior: A terminate_handler shall
> terminate execution of the program without
> returning to the caller.
>
> Does anyone have any idea whether the wording for the
> terminate_handler might be too strict now that we have threads in the
> std?

The wording of the current draft reflects the intention
of the committee that there shall be no data race and
no per-thread local terminate handler, see the proposal

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3189.htm

which became accepted in Batavia 2010. Per-thread handlers are often
hard to manage and it is always possible to define a single handler
that again queries a thread-local to get the actual handler, if you
really want, but not vice versa.

HTH & Greetings from Bremen,

Daniel Krügler




--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

std::terminate per thread - std vs. MS practice?  "Martin B." <0xCDCDCDCD@gmx.at> - 2011-03-31 16:33 -0600
  Re: std::terminate per thread - std vs. MS practice?  Daniel Krügler <daniel.kruegler@googlemail.com> - 2011-04-01 07:52 -0600
  Re: std::terminate per thread - std vs. MS practice?  Dragan Milenkovic <dragan@plusplus.rs> - 2011-04-01 07:52 -0600

csiph-web