title: Why should session_write_close be used in long polling?
body: <p>I was reading an article about long polling at <a href="http://www.nolithius.com/game-development/comet-long-polling-with-php-and-jquery" rel="noreferrer">Nolithius</a>. Under the section <strong>PHP sleeps across the entire session</strong>, it is written that the <code>session_write_close</code> function should be called in order to prevent the entire session coming to a deadlock. What exactly is meant by deadlock here? Does it mean that without this function, any other page from the same domain opened in the client side won't be able to receive AJAX data from other scripts (like this one) until this one has finished executing and returned the result? Why should this happen? And how can <code>session_write_close</code> help here? Won't using it remove all personalization from the client side the next time he requests a page from this domain after he has received data from this request?</p>