- Chris Stehno, SCPJ
Unfortunately the singleton solution would not work due to the fact that each of the three or more distinct applications would all attempt to load the same DLL in their singletons.
But DLLs are loaded by the JVM using a System.loadLibrary() call, not by the Java classloader, aren't they?Originally posted by William Brogden:
[...] Seems to me that if each application has its own class loader, your three singletons are in separate contexts, each with its own copy of the DLL is exactly what you want.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Often the most important part of the news is what they didn't tell.
Originally posted by William Brogden:
Thats not simple to do because the webapps would both have to listen to the same port, wouldn't they?
Originally posted by Tim Holloway:
I don't pretend that all of this is making sense to me, but one of the primary reasons for the concept of a DLL to begin with was to share common code. While Windows file locking isn't the brightest, I'm pretty sure I remember that a DLL could be opened multiple times in a single app, even if that app isn't multithreaded. Unless I've simply confused myself with one of the other OS's I've worked with, there's a use count and it gets bumped up when new opens are done, bumped down when unloads are done, and when it goes back down to 0, the DLL can be unloaded.
OTOH, if the problem is contention, ANY resource that's expecting integrity when accessed by multiple threads - and every http requester can be counted as a seperate thread for most purposes (whether 1 context or 100) - is going to have to be multithreading aware, no matter what languages and servers are involved. This can be done directly in the code or by guarding the code with synchronization wrappers, but if you don't do SOMETHING, things will blow apart at unpredictable moments.
lets say I wanted to two completely isolated webapps (basically two apps running in two distinct instances of the JVM - possibly even different versions of the JVM).
how would i do this?
Over here we're using Apache (running on demo.objectivity.co.uk:80) to proxy subdirectories (e.g. demo.objectivity.co.uk:80/foo) through to the actual machines that run the demo (say, foo.internal:8080). So that's one way to do it.Originally posted by Dave Hanson:
lets say I wanted to two completely isolated webapps (basically two apps running in two distinct instances of the JVM - possibly even different versions of the JVM).
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |