php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #62799 Parallel array processing
Submitted: 2012-08-11 19:50 UTC Modified: 2012-08-12 18:38 UTC
Votes:4
Avg. Score:4.0 ± 1.7
Reproduced:3 of 4 (75.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: info at ludwig-gramberg dot de Assigned:
Status: Open Package: Arrays related
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: info at ludwig-gramberg dot de
New email:
PHP Version: OS:

 

 [2012-08-11 19:50 UTC] info at ludwig-gramberg dot de
Description:
------------
Idea: an easy to use parallel processing function for arrays (or any iterable 
data structure).

Example:

<?php
$arr = array(1, 2, 3, 4);
array_process_parallel($arr, function($a) { return $a+5; });
?>

Now $arr would contain the following: [6, 7, 8, 9].
The values are written back to $arr. The parameter is called by reference.

Also a array_parallel_reduce would be nice.

Test script:
---------------
$arr = array(1, 2, 3, 4);
array_process_parallel($arr, function($a) { return $a+5; });

Expected result:
----------------
[6, 7, 8, 9]


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-12 13:01 UTC] laruence@php.net
do you mean something like array_map?  
http://us2.php.net/manual/en/function.array-walk.php
 [2012-08-12 13:01 UTC] laruence@php.net
s ,array_map,array_walk,  :)
 [2012-08-12 18:38 UTC] info at ludwig-gramberg dot de
yes, array_walk, map and so on could all be done in parallel, which would be very 
interesting speedwise
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Tue Nov 13 05:01:25 2018 UTC