hswerdfe wrote On 05/07/07 15:55,:
>>hswerdfe wrote On 05/07/07 15:16,:
>>[... has a library of Fortran code that models one Tank;
[quoted text clipped - 9 lines]
> I want to be able to communicate with the Model in a dynamic way.
> I am not sure I/O streams would be efficient.
(Shrug.) Which is more efficient: Something that might
be slow, or something that doesn't work?
> I thought the JNI was the best way to go.
> I am open to other suggestions if you have some.
>
> At any rate, the conversion to DLL is mostly already done.
> and all the required access methods exist.
> At this point I need a way to make several Instances of it.
You may have wasted your effort. Well, perhaps not
entirely wasted: Maybe you can attach the DLL to several
independent JVM instances, each handling one Tank, and use
RMI to control those Tanks from one "master" JVM. It's
really just the separate-program idea again, but using a
different communication method.
But getting one DLL attached to the same program
multiple times? And keeping all the subroutine linkages
straight, in some magical instance-specific way? I think
you're out of luck, unless you're going to write your own
native DLL loader ;-)
The Fortran code as you describe it implements what
amounts to a singleton. That's not what you'd like, but
that's the way it is. You can try to de-singularize the
singleton, or you can accept its singular nature and find
other ways to work with it.
(By the way: I don't mind receiving E-mail, but it's
confusing when the same message arrives on two separate
channels. Please send E-mail *or* post to Usenet, but
not both. Thank you.)

Signature
Eric.Sosman@sun.com
hswerdfe - 08 May 2007 00:33 GMT
> hswerdfe wrote On 05/07/07 15:55,:
>>
[quoted text clipped - 14 lines]
> (Shrug.) Which is more efficient: Something that might
> be slow, or something that doesn't work?
you make a good point.
I may eventually go this way.
>> I thought the JNI was the best way to go.
>> I am open to other suggestions if you have some.
[quoted text clipped - 8 lines]
> singleton, or you can accept its singular nature and find
> other ways to work with it.
The 3 most obvious course of action I see are
1.) To figure out how a structure works in fortran put all the data I
need in the structure the modify all the system calls to take that
sturcture as the first argument.
2.) put everything in Java.
3.) Use your I/O Stream Idea
problem is 1 and 2 both are large rewrites. And the point of this Tank
Model is to show how to take an existing single use fortran program and
modify it to work in an easy to configure and dynamically change Java
Wrapper, and 3 might be hard to configure some of the functionality that
I need.
> (By the way: I don't mind receiving E-mail, but it's
> confusing when the same message arrives on two separate
> channels. Please send E-mail *or* post to Usenet, but
> not both. Thank you.)
Thanks for all your help, and sorry about the double post. I usually try
to keep the thread on the news group as it might be useful to somebody
else at some point. My only excuse for hitting reply all and not reply
is that the Shift Key is next to the Ctrl Key.