[英]PHP Amp/Parallel. Please give me example about parallel function with pool
I have been stuck in my task about running functions in parallel. 我一直沉迷于有关并行运行功能的任务。 I has tried this library multi-threading pthreads from krakjoe , but I has limit knowledge about installations in ubuntu.
我已尝试过来自krakjoe的这个库多线程pthreads ,但我对ubuntu中的安装有一定的了解。 I has tried this amp/parallel instead and other amphp .
我试过这个amp / parallel和其他amphp 。 The examples in github is running well enough, but I can't implement it by my style.
github中的示例运行得很好,但我无法按照我的风格实现它。
I'm not familiar with whatever semantics , if there are many example to do within this amp/parallel. 如果在此amp / parallel中有很多示例要做,我对任何语义都不熟悉。 I would be very happy.
我会很高兴的。
The problems
问题
i need to run one function in parallel way, I want to read report from excel File, and bulk insert all the rows to database and this proccess needs two hours to be completed. 我需要以并行方式运行一个函数,我想从excel文件中读取报告,并将所有行批量插入数据库,这个过程需要两个小时才能完成。 And I want to repeat this functions in parallel way.
我想以并行的方式重复这些功能。 How to bulk insert and read file Excel I have knowledge to do it.
如何批量插入和读取文件Excel我有这样做的知识。
Please give me some example, whenever from blogs, website, or github about parallel functions or multi-threading in php7.2. 请给我一些例子,每当来自博客,网站或github关于并行函数或php7.2中的多线程。
I have found worked installation pthreads on ubuntu, and I have done some experiment on it. 我在ubuntu上找到了有效的安装pthreads,我已经做了一些实验。 This questions can be closed.
这个问题可以关闭。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.