JNI thread vs. native thread vs. JNI call

Discussion in 'Java' started by bgabrhelik, Sep 29, 2009.

  1. bgabrhelik

    bgabrhelik

    Joined:
    Sep 29, 2009
    Messages:
    1
    Likes Received:
    0
    Dears,

    I need to call from Java code subsequently native methods (JNI), but the requirement is that they are called in the same native thread. By native thread I mean the Operating System thread. Can I rely on that the JVM thread will be scheduled with the same native thread? Is it defined somehow? If not, cannot I ensure that by synchronizing of block of code?

    The reason is that an API I want to call is Thread Local Storage sensitive. It is Windows impersonation. I would like to avoid duplicating of native methods in JNI - a typical and an impersonation version. Any thoughts and/or suggestions?

    Thanks in advance
    Bronislav Gabrhelik
     
    bgabrhelik, Sep 29, 2009
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Abhishek Singh

    JVM crashes: Native method, JNI

    Abhishek Singh, Jul 23, 2003, in forum: Java
    Replies:
    2
    Views:
    1,022
    Nigel Wade
    Jul 23, 2003
  2. RThaden@web.de
    Replies:
    2
    Views:
    1,413
    RThaden@web.de
    Aug 2, 2006
  3. ckirchho@directmedia.de

    Java Native Interface: "Translate" java call to JNI

    ckirchho@directmedia.de, Sep 12, 2006, in forum: Java
    Replies:
    13
    Views:
    6,729
    ckirchho@directmedia.de
    Oct 9, 2006
  4. jadrian@wi.rr.com
    Replies:
    2
    Views:
    1,083
    jadrian@wi.rr.com
    May 10, 2007
  5. junzhang1983@gmail.com
    Replies:
    5
    Views:
    1,801
    Roedy Green
    Jun 20, 2008
  6. lavanya.msra@gmail.com
    Replies:
    0
    Views:
    451
    lavanya.msra@gmail.com
    Aug 24, 2010
  7. Vincenzo Piombo
    Replies:
    1
    Views:
    315
    nobu.nokada@softhome.net
    May 21, 2004
  8. -= Ko =- Black Ninja
    Replies:
    1
    Views:
    448
    -= Ko =- Black Ninja
    Apr 5, 2011
Loading...