Valerio Ferrucci wrote:

> Hi,
> I'm building a mutli thread C application using JNI and Invocation API to load
> Java Virtual Machine and call Java code.
> To launch a new thread I used the call:
>
> pthread_create
>
> Now that I link JNI, whit which call have I to substitute "pthread_create"?
> That is, how can I launch a new thread with JNI?

You have a couple of options:

- Launch the new thread from Java using the Thread class

- Launch the new thread with pthread_create(), as before, and use
AttachCurrentThread() in the invocation API to register your thread with the JVM

Nathan


>
>
> (I already substituted calls to pthread_mutex_lock and pthread_mutex_unlock
> with (*envP)->MonitorEnter and (*envP)->MonitorExit)
>
> Thanks for help
> ==================================================================
> Valerio Ferrucci                        Tabasoft Sas
> [EMAIL PROTECTED]                      http://tabasoft.ancitel.it
>                                         [EMAIL PROTECTED]
>
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to