Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Use existing c++ dll in Web Application

Posted on 2004-09-30
6
Medium Priority
?
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

604 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