From: Joseph Jones Date: 2015-12-17T21:13:00-07:00 Subject: [ruby-core:72327] [Ruby trunk - Feature #11817] [Open] map.parallel --567387cc_7f01579b_16c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Joseph Jones liked your message with Boxer. On December 14, 2015 at 15:53= :42 MST, eike=40inter.net wrote:Issue =2311817 has been reported by Eike = Dierks.----------------------------------------=46eature =2311817: map.pa= rallelhttps://bugs.ruby-lang.org/issues/11817* Author: Eike Dierks* Statu= s: Open* Priority: Normal* Assignee: ------------------------------------= ----I'd like to suggest a new method: =23parallelThat method should take = care of executing workloads in parallel across multiple cores.I believe t= hat =23map can sometimes be distributed to many simultaneous threads.So w= e would spread out the map blocks into parallel processing,and then colle= ct the results in order.I believe this would need some new infrastructure= like apple did with great=5Fcentral,so I'm talking along these lines.(Ak= a we only want to open up as many threads as there are cores)This would n= ot help much with a simple map (because we need to collect and serialize = the results in the end)but it could be cool for more complex mappings.May= be this should have been a rails topic first,because there it might make = a lot of sense to render partials in parallel,this could really speed up = rails response rendering ;-)But I believe this is a topic for ruby in gen= eral.Given that we now go to really many cores,it should be at the heart = of ruby to use that.=46or a start we could just declare =23parallel as ->= return self.and than improve on it.A naive implementation would just ope= n a new thread for every parallel map block,but that would not work well = -- it actually would be very slow.So we actually need a thread management= ,along the lines of great central.I believe this should be built into the= very core libs of the ruby language.I know this is hard stuff, but it ne= eds to be done.Let's go parallel from the heart of the language.---Please= let us discuss if adding the =23parallel method would be a good idea.Let= 's come up with some implementations to find the problems.I'm explicitly = referring to map=23parallel here.In rails that might be cache.parallel (i= f you followed)for some math tasks it might also be parallel do =7B=7D-- = https://bugs.ruby-lang.org/ --567387cc_7f01579b_16c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Joseph Jones liked your message with Boxer.


= On December 14, 2015 at 15:53:42 MST, eike=40inter.net wrote:
Issue =2311817 has been reported = by Eike Dierks.

----------------------------------------
= =46eature =2311817: map.parallel
https://bugs.ruby-lang.org/issues/1= 1817

* Author: Eike Dierks
* Status: Open
* Priority= : Normal
* Assignee:
----------------------------------------<= br />I'd like to suggest a new method: =23parallel

That method= should take care of executing workloads in parallel across multiple core= s.

I believe that =23map can sometimes be distributed to many = simultaneous threads.

So we would spread out the map blocks in= to parallel processing,
and then collect the results in order.
=
I believe this would need some new infrastructure like apple did wi= th great=5Fcentral,
so I'm talking along these lines.
(Aka we o= nly want to open up as many threads as there are cores)

This w= ould not help much with a simple map (because we need to collect and seri= alize the results in the end)
but it could be cool for more complex = mappings.

Maybe this should have been a rails topic first,
because there it might make a lot of sense to render partials in parall= el,
this could really speed up rails response rendering ;-)
But I believe this is a topic for ruby in general.
Given that we = now go to really many cores,
it should be at the heart of ruby to us= e that.

=46or a start we could just declare =23parallel as -> = return self.
and than improve on it.

A naive implementati= on would just open a new thread for every parallel map block,
but th= at would not work well -- it actually would be very slow.

So w= e actually need a thread management,
along the lines of great centra= l.

I believe this should be built into the very core libs of t= he ruby language.

I know this is hard stuff, but it needs to b= e done.
Let's go parallel from the heart of the language.

---


Please let us discuss if adding the =23parallel met= hod would be a good idea.
Let's come up with some implementations to= find the problems.

I'm explicitly referring to map=23parallel= here.
In rails that might be cache.parallel (if you followed)
=
for some math tasks it might also be
parallel do =7B=7D
























=










--
https://bugs.ruby-lang.org/
--567387cc_7f01579b_16c--