English 中文(简体)
PHP 校对和高校案查阅(例如:FTP)
原标题:PHP Threading and high-latency file access (eg; FTP)

这是一个很复杂的问题,因此,请不要跳跃得出结论,感到可以自由地问什么不够清楚。

基本上,我拥有一个以购买力平价书写的网络服务器。 请注意,网页信息是同步的,即对请求的答复可能需要很多时间,而所有用户都在工作(如适用)。

客户应当要求服务器查阅其他服务器的档案。 这可能是受援者基金的一个服务机构,或者说是德普箱。

在此,请注意两个问题:接线应当共享和再利用;服务器在开展工作时实际冻结,因此,任何请求都应在服务器已解冻后处理。

因此,我想到的是,为什么不把文件存取(即冻结服务器)到。 PHP threads?

这里的问题有两个方面;

  • how do I make a connection resource in the main thread (the server) available to the sub threads (not possible with the above threading model)?
  • what would happen if two threads end up needing the same resource? It s perfectly fine if one is locked until the other one finishes, but we still need to figure out issue #1.

或许,如果你能够找到更好的解决办法,我热切希望听听说我的想法。 我也想有一个PHP即刻托管连接资源,但记忆非常紧张。

问题回答

PHP supports no threads. The purpose of PHP is to respond to web requests quickly. That s what the architecture was built for. Different libraries try to do something like threads but they usually cause more issues than they solve.

总的来说,实现你所希望的两条途径:





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签