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
    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. Advertising

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. RThaden@web.de
    Replies:
    2
    Views:
    993
    RThaden@web.de
    Aug 2, 2006
  2. ckirchho@directmedia.de

    Java Native Interface: "Translate" java call to JNI

    ckirchho@directmedia.de, Sep 12, 2006, in forum: Java
    Replies:
    13
    Views:
    6,043
    ckirchho@directmedia.de
    Oct 9, 2006
  3. jadrian@wi.rr.com
    Replies:
    2
    Views:
    797
    jadrian@wi.rr.com
    May 10, 2007
  4. lavanya.msra@gmail.com
    Replies:
    0
    Views:
    320
    lavanya.msra@gmail.com
    Aug 24, 2010
  5. -= Ko =- Black Ninja
    Replies:
    1
    Views:
    303
    -= Ko =- Black Ninja
    Apr 5, 2011
Loading...

Share This Page