Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JNI C-exit(1)

Reply
Thread Tools

JNI C-exit(1)

 
 
ganeshamutha@gmail.com
Guest
Posts: n/a
 
      03-05-2007
Hi,,

A C-process (JNI thread) connected with some thread.. i found few
problem...

1. When I want to suspend i called wait().. it was
suspended .. if i want to ask it to resume i called notify() and
notifyAll() but JNI thread not resuming from where it is left. When i
say start it is starting from initial position and after few
suspend / start .. Java get crashing..

*** What could be the wrong on there? How do can fix it?

2. I am keep on checking the status instance
JNIEnv *envG; jobject objG;
jclass cls=(*envG)->GetObjectClass(envG,objG);
jmethodId mid=(*envG)-
>getMethodID(envG,cls"wait_here","()Z");


if( *envG->CallBooleanMethod(envG,objG,mid))
{
/**Some Iteration***/
}
i want to quit the exact JNI thread (C-process) if Java
thread returns the bool as true. how do can i kill the exact C-
process.. i have used exit(1) in C but it was closed all the thread
including Java..
**** how do can i stop the Process ? which approach will
easy either through C or Java?

Thanks in advance,
Ganesh.

 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      03-05-2007
On 5 Mar 2007 04:31:49 -0800, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> A C-process (JNI thread) connected with some thread.. i found few
> problem...


A C-process is not a JNI thread. Explain what you mean here.

> 1. When I want to suspend i called wait().. it was
> suspended .. if i want to ask it to resume i called notify() and
> notifyAll() but JNI thread not resuming from where it is left. When i
> say start it is starting from initial position and after few
> suspend / start .. Java get crashing..
>
> *** What could be the wrong on there? How do can fix it?


Almost anything at all. When your application crashes it is most
likely not a problem with the logic (which you've described), but with
the code itself (which you haven't posted). The solution is to fix the
code.

> 2. I am keep on checking the status instance
> JNIEnv *envG; jobject objG;
> jclass cls=(*envG)->GetObjectClass(envG,objG);
> jmethodId mid=(*envG)-
>>getMethodID(envG,cls"wait_here","()Z");

>
> if( *envG->CallBooleanMethod(envG,objG,mid))
> {
> /**Some Iteration***/
> }



> i want to quit the exact JNI thread (C-process) if Java thread
> returns the bool as true. how do can i kill the exact C- process.. i
> have used exit(1) in C but it was closed all the thread including
> Java..
>
> **** how do can i stop the Process ? which approach will
> easy either through C or Java?


Make up your mind: are you talking about threads or processes?

The answer depends on how you started the thread (or process).
Possibly all you need to do is return from the method.

/gordon

--
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JNI thread vs. native thread vs. JNI call bgabrhelik Java 0 09-29-2009 03:33 PM
Re: JNI: Error loading DLL from JNI DDL vasanth Java 0 01-25-2005 11:03 AM
Re: JNI: Error loading DLL from JNI DDL vasanth Java 0 01-25-2005 11:01 AM
Porting JNI Windows under JNI LINUX + Wine ? Pasturel Jean-Louis Java 5 03-03-2004 07:50 PM
IBM's JNI fails where Sun's JNI works Alex Hunsley Java 4 11-04-2003 10:34 AM



Advertisments