Solved

Use existing c++ dll in Web Application

Posted on 2004-09-30
6
176 Views
Last Modified: 2010-03-17
Hi, i have a existing system in c++.
I have Many not thread safe dll´s.
I want to call them from my java web application.

Is there a better way to then use SingleThreadModel and isThreadSafe = "false"?

Is there a better way than copying, renaming and reloading the dll for every user?

I can´t make the dll´s thread safe. this would take me too long. (very much code to check)
the SingleThreadModel would be to slow (yes, i tried it :-( )

creating a new process with Runtime and connect to it with rmi is also too slow (i also tried that :-( )
0
Comment
Question by:Koma666
  • 2
6 Comments
 
LVL 13

Expert Comment

by:petmagdy
ID: 12326662
Hello I have a suggestion that may help:

1- Create a Single Tone Java Class to wrap the Native DLL APIs and make all the methods synchronized

the single tone class looks like this:

class MySingleTone
{
 
  private static MySingleTone instance = null;

  private MySingleTone()
  {
     // Initialize
  }
 
   public static MySingleTone getInstance()
   {
     if(instance == null)
     {
        instance = MySingleTone();
     }
     return instance;
   }

   public synchronized callDllMethod()
   {
     // call ur DLL functions
   }

}
0
 
LVL 5

Author Comment

by:Koma666
ID: 12562995
I can´t do that.
The dll has to be initiated for every user.
It´ll crash if i use one instance for all users.
0
 
LVL 5

Author Comment

by:Koma666
ID: 12563007
I found a way
I found a way to speed up the single thread model by using more cach funktions.
So it´s not the best way but it´s fast enough to use it.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12573297
PAQed with points refunded (250)

modulo
Community Support Moderator
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now