我对理解任何编程语言(Java/Perl/Python/PHP)中的分布式并行编程模型很感兴趣-类似于Apache Hadoop,但支持Windows机器(我不想安装Cygwin)。
此外,我不热衷于高可用性和容错。
示例:创建一个名为"sum“的作业,并从客户端提交它,这样它就可以在多个worker节点上运行(包括没有cygwin的windows机器)。
sum(int a, int b)
{
return a+b;
}发布于 2013-02-25 17:06:46
请考虑Gearman:http://gearman.org/
perl gearman服务器在windows下运行,没有cygwin:http://code.activestate.com/ppm/Gearman/
http://www.phpvs.net/2010/11/30/installing-gearman-and-gearmand-on-windows-with-cygwin/
发布于 2013-02-25 17:23:56
你需要的就是ZeroMQ ..。您可以在没有cygwin的情况下简单地在windows上实现多个工作进程
下面是一个用PHP编写的简单并行任务工作器,它接收一条消息,休眠几秒钟,然后发出结束的信号
$context = new ZMQContext();
// Socket to receive messages on
$receiver = new ZMQSocket($context, ZMQ::SOCKET_PULL);
$receiver->connect("tcp://localhost:5557");
// Socket to send messages to
$sender = new ZMQSocket($context, ZMQ::SOCKET_PUSH);
$sender->connect("tcp://localhost:5558");
// Process tasks forever
while ( true ) {
$string = $receiver->recv();
$json = json_decode($string,true);
// Do the work
echo sum($json['left'], $json['right']), PHP_EOL; // <--- call SUM
usleep(strlen($string) * 1000);
// Send results to sink
$sender->send("");
}Here is a good place to start
发布于 2013-02-25 17:54:36
尝试使用IPython进行并行计算!
https://stackoverflow.com/questions/15063178
复制相似问题