dpd3447 2013-08-09 14:47
浏览 30

too long

While testing for a long execution script I came across a strange problem so I tried to test it using a simple script. For sake of testing I made a simple PHP page with below codes.

<?php
sleep(60);
echo 1; 
?>

I ran this page in the browser and while it was executing in the mean time made changes to the code by just simply commenting the sleep function, saved it and then ran the same page in another tab of the same browser. I was expecting the output should come instantly in the second tab but it came only after execution of the code in the first tab.

I repeated the above steps but this time appending random numbers in query string. It worked as expected i.e. though first tab was executing the page second tab echoed the result.

Now I am interested to know why browsers are not executing the same page in two different tabs though the page had changed in the mean time. I tested it in Firefox and chrome and my server is Apache.

  • 写回答

1条回答 默认 最新

  • dongliu5475 2013-08-09 14:59
    关注

    I bet you use session. session_start() locks the session file, or waits until it's unlocked by other process. Use session_write_close() as soon as possible.

    评论

报告相同问题?

悬赏问题

  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 MATLAB中streamslice问题
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端