812. unsolicited multithreading considered harmful?

Section: 26.8.2 [alg.sort] Status: NAD Editorial Submitter: Paul McKenney Opened: 2008-02-27 Last modified: 2016-01-28

Priority: Not Prioritized

View all issues with NAD Editorial status.

Discussion:

Multi-threading is a good thing, but unsolicited multi-threading can potentially be harmful. For example, sort() performance might be greatly increased via a multithreaded implementation. However, such a multithreaded implementation could result in concurrent invocations of the user-supplied comparator. This would in turn result in problems given a caching comparator that might be written for complex sort keys. Please note that this is not a theoretical issue, as multithreaded implementations of sort() already exist.

Having a multithreaded sort() available is good, but it should not be the default for programs that are not explicitly multithreaded. Users should not be forced to deal with concurrency unless they have asked for it.

[ This may be covered by N2410 Thread-Safety in the Standard Library (Rev 1). ]

Proposed resolution:

Rationale:

This is already covered by 17.6.5.6/20 in N2723.