C++ Standard

3 Posts tagged with the library tag
0

The Library side brought about some of the most interesting changes. I already discussed the key discussions with respect to unifying the Asynchronous futures proposal in The View (or trip report) from the Oct 2009 C++ Standard meeting.

This resulted in a paper which will be published in the upcoming mailing (in about a week from now), which will show the approach on Asynchronous Call A Simple Asynchronous Call.

The key changes there were:

  • A restoration of the variadic thread and async functions. This restoration is a consequence of analysis and request of the British Standards Institute.
  • A convergence on the "as if a new thread" in the launching of asynchronous work. This change avoids undefined behavior arising from any delay in destroying thread-local variables, but requires careful implementation to avoid excessive overhead.
  • Removal of the is_ready, has_exception, and has_value query functions. The presence of these function requires still other functions in the synchronous case. Evolution Working Group direction is that the complexity in interface is as yet unjustified, and prudence dictates a smaller initial interface.
  • Unspecified behavior for the use of timed wait functions when the unique_future was created from a deferred async.
  • The conversion from unique_future to shared_future will execute any deferred work.
  • The use of an enum class to better clarify the launching policy.

The other papers which support this is a resolution of most of the futures issues from National Body comments in Issues on Futures (Rev. 1) . A future describes components that a C++ program can use to retrieve in one thread the result (value or exception) from a function that has run in another thread.

These components are not restricted to multi-threaded programs but can be useful in single-threaded programs as well.

The other resolved issues include:



  • moves swap from the <algorithm> header to <utility> to address UK 300 because swap has become a common utility operation with several common idioms relying on it




Most of these are motivated by National Body comments from CD1. This shows the effort and focus of the committee during these periods as we continue to resolve the almost 600 comments that was received from the September 2008 CD1 draft.

There is now plan to issue a second draft for comment (post removal of Concepts, and with the fixes like above from CD1 comments). This will be CD2 and will be aimed for release after the next meeting in March 2010, in Pittsburgh hosted by Carnegie Mellon.

I will describe in another post more details on the schedule changes which is now clearer and I have updated in the C/C++ Standard hub

0 Comments Permalink
0

One of the issue we were concerned about at this meeting was the intent to deprecate trigraphs. We wrote a paper indicating why we oppose this. This was reviewed in the Evolution Committee and many delegates accepted our position and need to support existing customers. This is good for existing trigraph users.

However, discussion in committee indicate that if we can find an alternate way to support these users then we should explore that with the blessing of the committee. I will be looking at alternatives in future postings.

The C++ Standard Library Working Group also ratified four proposals into the C++0x draft.

C++0x Stream Positioning

C/C++ I/O files predates modern file sizes, and are usually based on int or long. This proposal allows them to work better with the new long long type in C++0x.

Specifying the complexity of size() (Revision 1)

This paper addresses the issue of testing size() and not knowing their complexity constraint. This makes it difficult to use containers where testing size is a frequent operation.

Thread Unsafe Standard Functions

This paper does not make C++ Standard functions thread unsafe, despite the name. Its intention is to clearly identify functions adopted from the C standard that need explicit exemption from the general prohibition on data races.

For example, these are already exempt:
asctime, ctime, gmtime, localtime, strerror, strtok, rand,

The following functions may have previously been thread unsafe, but must be thread safe to enable effective programming. By failng to mention these functions, the standard implicitly requires them to be thread safe.

atexit, at_quick_exit, exit, fclose, free, quick_exit, malloc, signal

Furthermore, C++ locale objects are already adequate for thread-safe locales; setlocale() is thread-unsafe.

Fixing freestanding: iteration 2.2

A freestanding platform is one that has an Operating System. This proposal aims to:
· enable the intent of the freestanding specification compliance to be preserved, by adding only two headers to it relative to its C++98/C++03 contents, namely <initializer_list> and
<type_traits>
· maintain the historically low dependency of the C++ language, and of C++ compilers, on a corresponding library

The benefits of this proposal are:
· it enables current users of the freestanding specification to continue using that specification
· it enables compiler implementers to work fairly independently of library supply
· it enables library implementers to work fairly independently of compiler supply

0 Comments Permalink
0

The mailing for the July C++ Standard meeting has been released. For those who do not understand this process, this is basically where everyone writes up their work for the upcoming meeting so we have something concrete to discuss.

IBM has submitted 2 papers. One is a direct response to the proposed trigraph deprecation as discussed here:

http://www-949.ibm.com/software/rational/cafe/thread/2293?tstart=0
and
http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/06/03/intention-to-deprecate-trigraphs-in-the-next-c-standard

are posed in these papers:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2910.pdf

We have also submitted a paper based on IBM research:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2911.pdf

on how to improve compatibility between C++ library implementations for C++ iterators:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2913.pdf

I will say more on these papers in a future blog.

0 Comments Permalink

C++ Standard

Bottom Banner