LWN.net Logo

A look at C++14: Papers Part 2

Here's the second part in the C++14 papers series on the "Meeting C++" site. "A proposal for Executors, objects that can execute units of work packaged as function objects. So this is another possible approach to task based parallelism, where the executor object is used as a reusable thread, that can handled a queue of tasks. One possible implementation of an executor is a thread-pool, but other implementations are possible."
(Log in to post comments)

A look at C++14: Papers Part 2

Posted Apr 1, 2013 18:37 UTC (Mon) by heijo (guest, #88363) [Link]

How about dividing the mass of mere library proposals from the actually interesting language proposals?

A look at C++14: Papers Part 2

Posted Apr 2, 2013 22:57 UTC (Tue) by robert_s (subscriber, #42402) [Link]

That's kinda the job of the open standards group.

A look at C++14: Papers Part 2

Posted Apr 2, 2013 23:13 UTC (Tue) by jwakely (subscriber, #60262) [Link]

If you mean www.open-std.org, it's noone's job and there is no open standards group, there's one volunteer who maintains the websites for several standards bodies.

There's a table at http://isocpp.org/blog/2013/03/pre-bristol-standards-pape... which categorizes the papers, the ones marked "Evolution" are probably the "interesting language" ones.

A look at C++14: Papers Part 2

Posted Apr 5, 2013 17:44 UTC (Fri) by robert_s (subscriber, #42402) [Link]

Head already spinning...

...I mean whoever's job it is to make the final decisions.

Swap

Posted Apr 1, 2013 21:18 UTC (Mon) by proski (subscriber, #104) [Link]

The swap operator looks interesting. I hope it would come to C as well. Perhaps it could be made atomic at least for some types.

Swap

Posted Apr 2, 2013 9:17 UTC (Tue) by tialaramex (subscriber, #21167) [Link]

I can imagine that there might be platforms on which (especially for larger or more sophisticated native C types like doubles) atomic swap is not practical.

So perhaps C could consider offering swap with no promises of atomicity, plus a set of reserved pre-processor variables which tell us whether atomicity is implemented for specific types. This would let you do

#if !defined(SWAP_UINT64_T_IS_ATOMIC)
#error This program requires an atomic swap for unsigned 64-bit integers but you don't have one. Too bad.
#endif

... or something more useful, but you get the idea.

Swap

Posted Apr 2, 2013 20:12 UTC (Tue) by scottwood (subscriber, #74349) [Link]

If non-atomic swap is a useful addition, why would you want to slow down swaps that don't need to be atomic by making it automatic, even if it's optional for the implementation? Atomic swap should be a specially requested operation (e.g. using compiler intrinsics), just like most other atomic operations.

Swap

Posted Apr 3, 2013 5:05 UTC (Wed) by Ben_P (subscriber, #74247) [Link]

Atomic swaps on doubles (and floats) are made more tricky by the fact very often NaN != NaN.

Swap

Posted Apr 5, 2013 23:18 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

Can't you just treat them as integers of the same size for CAS?

Swap

Posted Apr 2, 2013 20:31 UTC (Tue) by wahern (subscriber, #37304) [Link]

Are there any architectures where there exists an atomic, wait-free swap between two memory locations?

I suspect that they're uncommon if not non-existent.

In any event, presumably such an operation was left out of the stdatomic.h libraries for C11 and C++11 for a reason.

Swap

Posted Apr 3, 2013 11:04 UTC (Wed) by heijo (guest, #88363) [Link]

Haswell CPUs with TSX.

A look at C++14: Papers Part 2

Posted Apr 2, 2013 23:56 UTC (Tue) by daniel (guest, #3181) [Link]

Designated initializers? Conspicuously absent.

A look at C++14: Papers Part 2

Posted Apr 3, 2013 8:33 UTC (Wed) by jwakely (subscriber, #60262) [Link]

Right. I don't remember ever seeing a formal proposal to add them, and there is strong opposition to them from some parts of the committee.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds