Hi,
Here is my problem:
I am spirited coding java interface to perform various tasks (eg video encoding, audio (de) multiplexing, encryption, etc.).
Most of these operations are performed by C / C + +. J'interface therefore necessary C functions via JNI (Java Native Interface Using C function in Java) which requires recompiling the C / C + + as dll. Until not the problem.
Now I can run multiple identical tasks simultaneously (eg two audio encodings) which will then use the same dll.
Each thread is launched from Java (java.exe [| javaw.exe]) and so they all run in the same process. I therefore income follows a similar case a prog C / C + + that generates multiple threads, each of which can be used "simultaneously" to a single function of a dll.
1. I guess I should compile my dll with multithreaded. YES | NO?
2. How ca this place internally in the variables? Is that AC is a problem of sharing even if a function is called simultaneously by 2 threads of the same process? (I ask this because I think the dll provides an instance of code per process, not per thread).
3. The prog C / C + + Original contains global variables that are shared between all processes that use the dll (well, I think). Someone was there an idea that I could manage a sort of environmental thread (eg if we can execute a function of the thread takes the hand and affect global variables with hers)?



Reply With Quote
Copyright Techfuels
Bookmarks