PHP 4.0 Bug #10146: PHP Servlet is not thread-safe
| From: | rthornto at insight dot com | Date: | Tue, 03 Apr 2001 22:08:46 +0000 |
| Subject: | PHP 4.0 Bug #10146: PHP Servlet is not thread-safe | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-50775@lists.php.net to get a copy of this message | ||
From: rthornto@insight.com
Operating system: RedHat Linux 7.0
PHP version: 4.0.4pl1
PHP Bug Type: Java related
Bug description: PHP Servlet is not thread-safe
The PHP servlet is not thread-safe. This causes some versions of Tomcat to crash. But while Tomcat
3.1 will run pages without crashing, large pages loaded very close together end up writing to the
same output stream. This is caused by the HttpServletRequest and HttpServletResponse objects being
declared as instance objects within the net.php.servlet class. Less resource-intensive pages
finish processing fast enough that the output streams don't collide, but when a request is made
before a large request is finished, the result of the the first response will get printed with the
second.
One possible solution is that if multiple request and response objects could be stored (e.g in a
hash) and matched back up in the net.php.servlet callback methods, the servlet would then be
thread-safe.
--
Edit Bug report at: http://bugs.php.net/?id=10146&edit=1