Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

André,

On 4/7/2009 7:57 AM, André Warnier wrote:
A Schrödinger Tomcat would be one that exists multiple times, in quantum
superposition. Which would probably create problems with all of them
trying to listen on the same TCP ports. Unless of course the listening
port only gets instantiated at the first interaction with one of the
Tomcats.

I would think that a Schrödinger Tomcat would be one configured thusly:

1. ROOT context captures all incoming requests and routes them to the
   CheckForTomcatRunningServlet.
2. CheckForTomcatRunningServlet is implemented as follows:

   public void service(...) {
     System.exit(0);
   }

Tomcat is either up or not.
I would have to disagree again.
The Tomcat you describe above is totally deterministic : it is alive (since it can receive your request), but as soon as you interact with it, it dies. In my view, the Schrödinger Tomcat's existence is never in doubt. There are even an infinity of them, each one having some probability of being more or less alive or dead. As soon as you interact with it/them however, you automatically select one of them. Thus the code above should at least incorporate the following pseudo-code modification :

>    public void service(...) {
       if (random(1) < 0.5)
>        System.exit(0);
       else
         response.print(locale("miaou"));
>    }

The question in fact really boils down to whether these quantums of life extend or not to the listening port. Can it be for example half-open ? And is a half-open port 8080 equivalent to a fully-open port 4040, or does it just have only half the bandwidth ?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to