Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

JNI C-exit(1)

Thread view: 
ganeshamutha@gmail.com - 05 Mar 2007 12:31 GMT
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.
Gordon Beaton - 05 Mar 2007 12:55 GMT
> 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
[quoted text clipped - 3 lines]
>
> ***  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;
[quoted text clipped - 6 lines]
>                    /**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
[quoted text clipped - 3 lines]
> **** 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

Signature

[ 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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.