JNI again

Daniel Dittmar dittmar at berlin.snafu.de
Wed Aug 13 14:59:03 PDT 1997


> Umm... this does not necessarily follow.  In particular, Sun's servlet
> server extension API runs different requests as different *threads* in
> the same VM.

True. Unfortunately, the server software is already implemented and
synchronizing access to the VM would be too much overhead.

> However, it also allows a server extension to accumulate information
> on its history, the state of outstanding requests, and so forth, in a
> manner which would be a great deal more difficult if different
> instances of the extension were walled off in separate VMs (which
> means, in principle, separate address spaces).

Often, class variables are used as a replacement for global variables. I
remember one C++ string class which used a class member to indicate
whether compare should be case sensitive. You wouldn't want to share
such a variable across requests working in parallel.

> Also, multiple-threads-in-single-VM allows significant saving of
> resources (say, one open JDBC connection shared by all requests to a
> given server extension, as opposed to one per VM ... )

The server I'm working on is actually a database server which should use
Java as its extension language so each request has already exactly one
database session.

Daniel Dittmar (mailto:dittmar at berlin.snafu.de)



More information about the kaffe mailing list