News for hackers. Stuff that matters.
Re:Parallel STL by askee on Saturday May 09, 2015 @03:16AM (#9515772)
GCC already has something alike, the parallel mode [1]. It is based on the Multi-Core STL (MCSTL) developed at Karlsruhe University. In [2] you can also find some publications. As far as I know this already works quite well.

[1] https://gcc.gnu.org/onlinedocs/libstdc++/manual/parallel_mod... [2] http://algo2.iti.kit.edu/singler/mcstl/

Re:Parallel STL by chrisseaton on Friday May 08, 2015 @07:26PM (#9514710)
Yet another parallel for-loop.

If you have a finite number of totally independent load balanced operations to run in parallel, then you don't really have a parallelism problem in the first place.

We need libraries to help us where the operations are not independent and not balanced.

Re:Parallel STL by humanrebar on Friday May 08, 2015 @08:56PM (#9514966)
Except this is an implementation of a proposed standard parallel for loop. The main purpose of a standard is to codify old-hat technologies so people don't have to reinvent the wheel anymore.
Re:Parallel STL by lorenzhs on Saturday May 09, 2015 @03:50AM (#9515819)
But this is not another #pragma omp parallel for. It's a parallel implementation of STL algorithms like std::sort or std::nth_element etc. - you can replace your sequential calls by multithreaded versions easily. Like the top post, I would recommend having a look at GNU's parallel mode (aka MCSTL, Multi Core STL). Peter Sanders recognized the potential of such an implementation very early, his group published the first version of MCSTL in 2006: http://algo2.iti.kit.edu/singler/mcstl/

Sadly, it looks like it didn't get continued by the GNU folks after they integrated it. It still exists, though.

Re:Parallel STL by malkia on Friday May 08, 2015 @08:28PM (#9514896)
Spot on. There either needs to be some kind of OS level control (Grand Central), or tweaks through the environment, like OpenMP - where you set in advance how much threads are to be used by the process.

I think Microsoft's PPL had something where it would've cooperated with the OS, but things did not worked out as expected and it wasn't delivered. Or I could be completely wrong, some links here:

https://msdn.microsoft.com/en-us/library/ee207192.aspx

https://msdn.microsoft.com/en-us/library/dd984036.aspx

Re:Parallel STL by jfbastien on Friday May 08, 2015 @09:34PM (#9515067)
You're thinking of C++'s "executor", which is currently being discussed for addition to the standard. The parallel STL will use the executors once they're added to a technical specification. There's agreement on how integration this will work, and that it's the right thing to do, but executors don't have a fully agreed-upon API yet.

We (the C++ standards committee) discussed these things further this week :-)

Re:Parallel STL by malkia on Friday May 08, 2015 @09:40PM (#9515082)
Ah, thanks for correcting me. I've read about it year or more ago, a short article and I couldn't find it.
Re:Parallel STL by jfbastien on Friday May 08, 2015 @09:54PM (#9515133)
There are a lot of papers to follow, unfortunately. Listed here: http://open-std.org/jtc1/sc22/wg21/docs/papers/2014/ http://open-std.org/jtc1/sc22/wg21/docs/papers/2015/

You'll want to follow mostly Mysen's and Kohlhoff's proposals on executors.

Re:Parallel STL by jevinskie on Friday May 08, 2015 @08:59PM (#9514972)
I was going to suggest GCD as well. IIRC it's FreeBSD implementation is great and it's Linux port is adequate. But yes, queues, producers, consumers, and OS level parallelism is the way to go!
[deleted]
Re:Parallel STL by chrisseaton on Friday May 08, 2015 @07:56PM (#9514804)
It's just we see so many parallel collections, parallel streaming, parallel map, parallel for-loop efforts, and they always rely on the problem being embarrassingly parallel in the first place!
Re:Parallel STL by _random_ on Saturday May 09, 2015 @05:31PM (#9517758)
Yet another parallel for-loop.

I wonder what is your opinion about JS MVC frameworks :).

Re:Parallel STL by twotwotwo on Friday May 08, 2015 @07:37PM (#9514752)
Can't not note--I recently put up a parallel radix sort and quicksort for Go at https://github.com/twotwotwo/sorts if you're into such things.
Re:Parallel STL by polskibus on Saturday May 09, 2015 @04:18AM (#9515846)
How does it differ from Intel's Threading Building Blocks?
Re:Parallel STL by eps on Saturday May 09, 2015 @04:26AM (#9515856)
Good question.

You are clearly familiar with Intel's Threading Building Blocks. Why don't you read up on the submitted implementation and answer your own question here for eveyone's benefit?

Re:Parallel STL by CyberDildonics on Sunday May 10, 2015 @02:23AM (#9519070)
Because someone might already know the answer.
Re:Parallel STL by lorenzhs on Saturday May 09, 2015 @11:05AM (#9516556)
TBB is much more low-level. This is a parallel version of the STL (including <algorithm>) and much easier to use as a drop-in replacement.
Re:Parallel STL by alamaison on Friday May 08, 2015 @07:32PM (#9514739)
Isn't this from March 2014?