Title
unsolicited multithreading considered harmful?
Status
nad editorial
Section
[alg.sort]
Submitter
Paul McKenney

Created on 2008-02-27.00:00:00 last changed 159 months ago

Messages

Date: 2011-03-05.00:04:13

Rationale:

This is already covered by 17.6.5.6/20 in N2723.

Date: 2010-10-21.18:28:33

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

Date: 2008-02-27.00:00:00

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.

History
Date User Action Args
2011-03-05 00:04:13adminsetmessages: + msg5587
2010-10-21 18:28:33adminsetmessages: + msg3861
2008-02-27 00:00:00admincreate