dcsimg
JNI Multithread in Linux Question
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   CK_Kok
Posted On:   Tuesday, January 6, 2004 11:26 PM

Dear friends, I have successfully integrated native (C++) codes which employ threading operation with a simple java program. The objective of the program is to spawn thread (using POSIX pthread_create) that prints 10 "Hello World". My Software environment: JBuilder9 (jdk1.4) in Linux 7.2. Seems that I have achieved what I wanted. However, a closer look at the java program depicts that the thread should terminate and exit way before the Native Method ThreadFunction() completes its execution of printing 10 "Hello World". This is because the java program (main process) should have exited. It appears to me that the native thread has seized the entire flow of control from java program and it is not running indep   More>>

Dear friends,

I have successfully integrated native (C++) codes which employ threading operation with a simple java program. The objective of the program is to spawn thread (using POSIX pthread_create) that prints 10 "Hello World". My Software environment: JBuilder9 (jdk1.4) in Linux 7.2.

Seems that I have achieved what I wanted. However, a closer look at the java program depicts that the thread should terminate and exit way before the Native Method ThreadFunction() completes its execution of printing 10 "Hello World". This is because the java program (main process) should have exited.

It appears to me that the native thread has seized the entire flow of control from java program and it is not running independently. Why is that so? How can I make the native thread independent and not seize the flow of control from the java program? I would really appreciate if you can my answer my questions. Thank you very much.

CK Kok

   <<Less
About | Sitemap | Contact