tags:

views:

182

answers:

1

Hello All,

I have my PHP scripts running on the WAMP server. Here's what i am doing

  1. PHP script A that queries the database and gets a set of rows (I have set the set_time_limit (0) // unlimited time for the script to execute )
  2. Based on the result set I execute a tcl script for each row of the result set
  3. The TCL script takes about a minute to execute , it also inserts some data to the same database
  4. Now simultaneously when the TCL script is executing , if i execute another PHP script that writes in to the database , I am not able to do it as the response time is too slow. It infact waits for the PHP script A/TCL script to complete
  5. However during this time, reads from the database is fine and quick

Does anyone has any suggestions ?

Regards, Mithun

+3  A: 

A Session cannot be shared by concurrent scripts. Any new requests which try to session_start() will hang at this point waiting for the previous script end.

As your script is taking undetermined time to end, its a good idea to session_write_close() right after obtaining all information it needs from the $_SESSION superglobal, so concurrent requests won't hang anymore.

Havenard
Thank you so much for the reply. It worked !!!
mithunmo